From: John Benediktsson Date: Mon, 22 Jan 2018 22:19:19 +0000 (-0800) Subject: irc-ui: move to irc.ui to match IN: declarations. X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor-unmaintained.git;a=commitdiff_plain;h=b7b07d7ae48d615ba6780afe850055f6581c4c3f irc-ui: move to irc.ui to match IN: declarations. --- diff --git a/irc-ui/authors.txt b/irc-ui/authors.txt deleted file mode 100644 index 9366723..0000000 --- a/irc-ui/authors.txt +++ /dev/null @@ -1 +0,0 @@ -William Schlieper diff --git a/irc-ui/commandparser/commandparser.factor b/irc-ui/commandparser/commandparser.factor deleted file mode 100644 index 43ea80c..0000000 --- a/irc-ui/commandparser/commandparser.factor +++ /dev/null @@ -1,15 +0,0 @@ -! Copyright (C) 2008 William Schlieper -! See http://factorcode.org/license.txt for BSD license. - -USING: kernel vocabs.loader sequences strings splitting words irc.messages ; - -IN: irc.ui.commandparser - -: command ( string string -- string command ) - [ "say" ] when-empty - dup "irc.ui.commands" lookup - [ nip ] - [ " " append prepend "quote" "irc.ui.commands" lookup ] if* ; - -: parse-message ( string -- ) - "/" ?head [ " " split1 swap command ] [ "say" command ] if execute ; diff --git a/irc-ui/commands/commands.factor b/irc-ui/commands/commands.factor deleted file mode 100644 index 93d1e2e..0000000 --- a/irc-ui/commands/commands.factor +++ /dev/null @@ -1,28 +0,0 @@ -! Copyright (C) 2008 William Schlieper -! See http://factorcode.org/license.txt for BSD license. - -USING: accessors kernel sequences arrays irc.client - irc.messages irc.ui namespaces ; - -IN: irc.ui.commands - -: say ( string -- ) - irc-tab get - [ window>> client>> profile>> nickname>> print-irc ] - [ chat>> speak ] 2bi ; - -: me ( string -- ) ! Placeholder until I make /me look different - "ACTION " 1 prefix prepend 1 suffix say ; - -: join ( string -- ) - irc-tab get window>> join-channel ; - -: query ( string -- ) - irc-tab get window>> query-nick ; - -: whois ( string -- ) - "WHOIS" swap { } clone swap - irc-tab get listener>> speak ; - -: quote ( string -- ) - drop ; ! THIS WILL CHANGE diff --git a/irc-ui/ircui-rc b/irc-ui/ircui-rc deleted file mode 100644 index a1533c7..0000000 --- a/irc-ui/ircui-rc +++ /dev/null @@ -1,9 +0,0 @@ -! Default system ircui-rc file -! Copy into .ircui-rc in your home directory and then change username and such -! To find your home directory, type "home ." into a Factor listener - -USING: irc.client irc.ui ; - -"irc.freenode.org" 8001 "factor-irc" f ! server port nick password -{ "#concatenative" "#terrorisland" } ! all the channels you want to autojoin -server-open diff --git a/irc-ui/load/load.factor b/irc-ui/load/load.factor deleted file mode 100644 index 88c0d35..0000000 --- a/irc-ui/load/load.factor +++ /dev/null @@ -1,16 +0,0 @@ -! Copyright (C) 2008 William Schlieper -! See http://factorcode.org/license.txt for BSD license. - -USING: kernel io.files io.pathnames parser editors sequences ; - -IN: irc.ui.load - -: file-or ( path path -- path ) [ [ exists? ] keep ] dip ? ; - -: personal-ui-rc ( -- path ) home ".ircui-rc" append-path ; - -: system-ui-rc ( -- path ) "extra/irc/ui/ircui-rc" resource-path ; - -: ircui-rc ( -- path ) personal-ui-rc system-ui-rc file-or ; - -: run-ircui ( -- ) ircui-rc run-file ; diff --git a/irc-ui/summary.txt b/irc-ui/summary.txt deleted file mode 100644 index 284672b..0000000 --- a/irc-ui/summary.txt +++ /dev/null @@ -1 +0,0 @@ -A simple IRC client \ No newline at end of file diff --git a/irc-ui/ui.factor b/irc-ui/ui.factor deleted file mode 100644 index d65817f..0000000 --- a/irc-ui/ui.factor +++ /dev/null @@ -1,250 +0,0 @@ -! Copyright (C) 2008 William Schlieper -! See http://factorcode.org/license.txt for BSD license. - -USING: accessors kernel threads combinators concurrency.mailboxes - sequences strings hashtables splitting fry assocs hashtables colors - sorting unicode math.order - ui ui.gadgets ui.gadgets.panes ui.gadgets.editors - ui.gadgets.scrollers ui.commands ui.gadgets.frames ui.gestures - ui.gadgets.tabs ui.gadgets.grids ui.gadgets.packs ui.gadgets.labels - io io.styles namespaces calendar calendar.format models continuations - irc.client irc.client.private irc.messages - irc.ui.commandparser irc.ui.load vocabs.loader classes prettyprint ; - -RENAME: join sequences => sjoin - -IN: irc.ui - -SYMBOL: chat - -SYMBOL: client - -TUPLE: ui-window < tabbed client ; - -M: ui-window ungraft* - client>> terminate-irc ; - -TUPLE: irc-tab < frame chat client window ; - -: write-color ( str color -- ) - foreground associate format ; -CONSTANT: dark-red T{ rgba f 0.5 0.0 0.0 1 } -CONSTANT: dark-green T{ rgba f 0.0 0.5 0.0 1 } -CONSTANT: dark-blue T{ rgba f 0.0 0.0 0.5 1 } - -: dot-or-parens ( string -- string ) - [ "." ] - [ "(" prepend ")" append ] if-empty ; - -GENERIC: write-irc ( irc-message -- ) - -M: ping write-irc - drop "* Ping" blue write-color ; - -M: privmsg write-irc - "<" dark-blue write-color - [ irc-message-sender write ] keep - "> " dark-blue write-color - trailing>> write ; - -M: notice write-irc - [ type>> dark-blue write-color ] keep - ": " dark-blue write-color - trailing>> write ; - -TUPLE: own-message message nick timestamp ; - -: ( message nick -- own-message ) - now own-message boa ; - -M: own-message write-irc - "<" dark-blue write-color - [ nick>> bold font-style associate format ] keep - "> " dark-blue write-color - message>> write ; - -M: join write-irc - "* " dark-green write-color - irc-message-sender write - " has entered the channel." dark-green write-color ; - -M: part write-irc - "* " dark-red write-color - [ irc-message-sender write ] keep - " has left the channel" dark-red write-color - trailing>> dot-or-parens dark-red write-color ; - -M: quit write-irc - "* " dark-red write-color - [ irc-message-sender write ] keep - " has left IRC" dark-red write-color - trailing>> dot-or-parens dark-red write-color ; - -M: kick write-irc - "* " dark-red write-color - [ irc-message-sender write ] keep - " has kicked " dark-red write-color - [ who>> write ] keep - " from the channel" dark-red write-color - trailing>> dot-or-parens dark-red write-color ; - -M: mode write-irc - "* " dark-blue write-color - [ name>> write ] keep - " has applied mode " dark-blue write-color - [ mode>> write ] keep - " to " dark-blue write-color - parameter>> write ; - -M: nick write-irc - "* " dark-blue write-color - [ irc-message-sender write ] keep - " is now known as " blue write-color - trailing>> write ; - -M: unhandled write-irc - "UNHANDLED: " write - line>> dark-blue write-color ; - -M: irc-end write-irc - drop "* You have left IRC" dark-red write-color ; - -M: irc-disconnected write-irc - drop "* Disconnected" dark-red write-color ; - -M: irc-connected write-irc - drop "* Connected" dark-green write-color ; - -M: irc-chat-end write-irc - drop ; - -M: irc-message write-irc - "UNIMPLEMENTED" write - [ class pprint ] keep - ": " write - line>> dark-blue write-color ; - -GENERIC: time-happened ( message -- timestamp ) - -M: irc-message time-happened timestamp>> ; - -M: object time-happened drop now ; - -: print-irc ( irc-message -- ) - [ time-happened timestamp>hms write " " write ] - [ write-irc nl ] bi ; - -: send-message ( message -- ) - [ print-irc ] - [ chat get speak ] bi ; - -GENERIC: handle-inbox ( tab message -- ) - -: value-labels ( assoc val -- seq ) - '[ nip _ = ] assoc-filter keys sort-strings [