mirror of https://github.com/xvxx/phetch
in with the new
parent
4e899783a2
commit
f47bf05e36
@ -0,0 +1,22 @@
|
||||
use types::Type;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Link {
|
||||
pos: usize, // which link in the page
|
||||
title: String,
|
||||
host: String,
|
||||
port: usize,
|
||||
selector: String,
|
||||
typ: Type,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Page {
|
||||
raw: String, // raw gopher response
|
||||
url: String, // gopher url
|
||||
links: Vec<Link>, // URL strings
|
||||
link: usize, // selected link
|
||||
typ: Type, // entry type
|
||||
input: String, // user's inputted value
|
||||
offset: usize, // scrolling position
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum Type {
|
||||
TextFile, // 0
|
||||
Menu, // 1
|
||||
CSOEntity, // 2
|
||||
Error, // 3
|
||||
BinhexFile, // 4
|
||||
DOSFile, // 5
|
||||
UUEncodedFile, // 6
|
||||
Search, // 7
|
||||
Telnet, // 8
|
||||
BinaryFile, // 9
|
||||
Mirror, // +
|
||||
GIF, // g
|
||||
Image, // i
|
||||
Telnet3270, // T
|
||||
HTMLFile, // h
|
||||
Information, // i
|
||||
Sound, // s
|
||||
Document, // d
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum Type {
|
||||
TextFile, // 0
|
||||
Menu, // 1
|
||||
CSOEntity, // 2
|
||||
Error, // 3
|
||||
BinhexFile, // 4
|
||||
DOSFile, // 5
|
||||
UUEncodedFile, // 6
|
||||
Search, // 7
|
||||
Telnet, // 8
|
||||
BinaryFile, // 9
|
||||
Mirror, // +
|
||||
GIF, // g
|
||||
Image, // i
|
||||
Telnet3270, // T
|
||||
HTMLFile, // h
|
||||
Information, // i
|
||||
Sound, // s
|
||||
Document, // d
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
use page::Page;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct UI {
|
||||
pages: Vec<Page>,
|
||||
page: usize,
|
||||
}
|
||||
|
||||
impl UI {
|
||||
pub fn new() -> UI {
|
||||
UI {
|
||||
pages: vec![],
|
||||
page: 0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn print(&self) {
|
||||
print!("{}", self.render());
|
||||
}
|
||||
|
||||
pub fn render(&self) -> String {
|
||||
String::new()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue