From 1ec6c10d95584e6034664ff2fa052ff65c73d483 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sun, 6 Aug 2017 14:22:54 -0400 Subject: [PATCH] Rename project to rust-sysbar. --- Cargo.toml | 11 +++++++---- LICENSE-MIT | 1 + README.md | 5 +---- examples/simple.rs | 14 +++++++------- src/lib.rs | 6 +++--- src/mac_os/mod.rs | 12 ++++++------ 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cf18d1f..2a3718a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,13 @@ [package] -name = "barfly" -version = "0.1.3" -authors = ["John Quigley "] +name = "sysbar" +version = "0.1.0" +authors = [ + "John Quigley ", + "Corey Farwell ", +] description = "WIP. Donut use. Implement osx dock/windows taskbar apps in rust." license = "MIT/Apache-2.0" -repository = "https://github.com/jmquigs/rs-barfly" +repository = "https://github.com/rust-sysbar/rust-sysbar" [dependencies] diff --git a/LICENSE-MIT b/LICENSE-MIT index f9a3718..9f0ebf6 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,5 @@ Copyright (c) 2017 The rs-barfly Developers +Copyright (c) 2017 The rust-sysbar Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/README.md b/README.md index a86b511..a875822 100644 --- a/README.md +++ b/README.md @@ -1,4 +1 @@ -# rs-barfly -Write osx dock and windows taskbar apps in Rust - -I am not actively working on this project at this time, but PRs are still welcome. +# rust-sysbar diff --git a/examples/simple.rs b/examples/simple.rs index a45decc..2d0d2b1 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -4,18 +4,18 @@ use std::collections::HashMap; use std::sync::{Arc, RwLock}; use std::mem; -extern crate barfly; -use barfly::Sysbar; +extern crate sysbar; +use sysbar::Sysbar; fn main() { - let mut fly = Sysbar::new("Barfly"); + let mut bar = Sysbar::new("Foo"); // make a hash map for the callbacks to mess with let hm: HashMap = HashMap::new(); let hm = Arc::new(RwLock::new(hm)); let phm = hm.clone(); - fly.add_item( + bar.add_item( "Prefs", Box::new(move || { let mut hm = phm.write().unwrap(); @@ -28,7 +28,7 @@ fn main() { ); let fhm = hm.clone(); - fly.add_item( + bar.add_item( "Summon Herb", Box::new(move || { let mut hm = fhm.write().unwrap(); @@ -44,7 +44,7 @@ fn main() { }), ); - fly.add_quit_item("Quit"); + bar.add_quit_item("Quit"); - fly.display(); + bar.display(); } diff --git a/src/lib.rs b/src/lib.rs index 5d37593..7faa096 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,11 +5,11 @@ mod mac_os; #[macro_use] extern crate objc; -pub struct Sysbar(PlatformFly); +pub struct Sysbar(SysbarImpl); impl Sysbar { pub fn new(name: &str) -> Self { - Sysbar(PlatformFly::new(name)) + Sysbar(SysbarImpl::new(name)) } pub fn add_item(&mut self, label: &str, cbs: Box ()>) { @@ -26,7 +26,7 @@ impl Sysbar { } #[cfg(target_os = "macos")] -type PlatformFly = mac_os::MacOsBarfly; +type SysbarImpl = mac_os::MacOsSysbar; #[test] fn it_works() { diff --git a/src/mac_os/mod.rs b/src/mac_os/mod.rs index 3851ebf..b8016a1 100644 --- a/src/mac_os/mod.rs +++ b/src/mac_os/mod.rs @@ -24,23 +24,23 @@ extern crate objc_foundation; pub use self::cocoa::foundation::{NSAutoreleasePool, NSString}; pub use self::objc_foundation::{INSObject, NSObject}; -pub struct MacOsBarfly { +pub struct MacOsSysbar { name: String, menu: *mut objc::runtime::Object, pool: *mut objc::runtime::Object, } -impl Drop for MacOsBarfly { +impl Drop for MacOsSysbar { fn drop(&mut self) { unsafe { self.pool.drain() } } } -impl MacOsBarfly { +impl MacOsSysbar { pub fn new(name: &str) -> Self { unsafe { let pool = NSAutoreleasePool::new(nil); - MacOsBarfly { + MacOsSysbar { name: name.to_owned(), pool: pool, menu: NSMenu::new(nil).autorelease(), @@ -154,7 +154,7 @@ impl INSObject for Callback { let mut decl = ClassDecl::new(&cname, superclass).unwrap(); decl.add_ivar::("_cbptr"); - extern "C" fn barfly_callback_call(this: &Object, _cmd: Sel) { + extern "C" fn sysbar_callback_call(this: &Object, _cmd: Sel) { println!("callback, getting the pointer"); unsafe { let pval: usize = *this.get_ivar("_cbptr"); @@ -172,7 +172,7 @@ impl INSObject for Callback { unsafe { decl.add_method( sel!(call), - barfly_callback_call as extern "C" fn(&Object, Sel), + sysbar_callback_call as extern "C" fn(&Object, Sel), ); } -- 2.51.2