mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-27 19:20:43 +01:00
refactor: split modules into separate dirs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::utils::c_str_to_rs_str_and_free;
|
||||
use super::utils::c_str_to_rs_str_and_free;
|
||||
|
||||
use crate::libnotify::*;
|
||||
use super::libnotify::*;
|
||||
|
||||
/* Initting
|
||||
*
|
||||
4
src/api/mod.rs
Normal file
4
src/api/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
pub mod functions;
|
||||
mod libnotify;
|
||||
pub mod notification;
|
||||
mod utils;
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::libnotify::*;
|
||||
use super::libnotify::*;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Urgency {
|
||||
@@ -7,7 +7,7 @@ pub unsafe fn c_str_to_rs_str_and_free(c_str: *mut std::os::raw::c_char) -> Opti
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
|
||||
unsafe { crate::libnotify::g_free(c_str as *mut std::ffi::c_void) };
|
||||
unsafe { super::libnotify::g_free(c_str as *mut std::ffi::c_void) };
|
||||
|
||||
Some(normal_string)
|
||||
}
|
||||
10
src/lib.rs
10
src/lib.rs
@@ -3,9 +3,7 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
pub mod builder;
|
||||
pub mod context;
|
||||
pub mod functions;
|
||||
mod libnotify;
|
||||
pub mod notification;
|
||||
mod utils;
|
||||
pub mod api;
|
||||
pub mod wrappers;
|
||||
|
||||
pub use wrappers::{builder, context};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
context::LibnotifyContext,
|
||||
notification::{HintValue, Notification, Timeout, Urgency},
|
||||
api::notification::{HintValue, Notification, Timeout, Urgency},
|
||||
wrappers::context::LibnotifyContext,
|
||||
};
|
||||
|
||||
pub struct NotificationBuilder<'a> {
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::functions::{init, is_initted, set_app_icon, set_app_name, uninit};
|
||||
use crate::api::functions::{init, is_initted, set_app_icon, set_app_name, uninit};
|
||||
|
||||
pub struct LibnotifyContext {}
|
||||
|
||||
2
src/wrappers/mod.rs
Normal file
2
src/wrappers/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod builder;
|
||||
pub mod context;
|
||||
Reference in New Issue
Block a user