From 68fd2fccc1a5c36ab89a67d7e920f8a329ba950f Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sun, 8 Sep 2019 13:50:09 +0200 Subject: [PATCH] Rename UI bridge --- native/libwinbridge/bridge.cpp | 2 +- native/libwinbridge/bridge.h | 2 +- src/bridge/windows.rs | 2 +- src/ui/windows.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/native/libwinbridge/bridge.cpp b/native/libwinbridge/bridge.cpp index f459755..a10bafc 100644 --- a/native/libwinbridge/bridge.cpp +++ b/native/libwinbridge/bridge.cpp @@ -331,7 +331,7 @@ LRESULT CALLBACK notification_worker_procedure(HWND window, unsigned int msg, WP } } -int32_t initialize_notification(wchar_t * icon_path) { +int32_t initialize_ui(wchar_t * icon_path) { g_espanso_icon = (HBITMAP)LoadImage(NULL, icon_path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); diff --git a/native/libwinbridge/bridge.h b/native/libwinbridge/bridge.h index 0676032..eb7b8c8 100644 --- a/native/libwinbridge/bridge.h +++ b/native/libwinbridge/bridge.h @@ -59,7 +59,7 @@ extern "C" int32_t get_active_window_executable(wchar_t * buffer, int32_t size); /* * Initialize the notification window. */ -extern "C" int32_t initialize_notification(wchar_t * icon_path); +extern "C" int32_t initialize_ui(wchar_t * icon_path); /* * Show a window containing the notification. diff --git a/src/bridge/windows.rs b/src/bridge/windows.rs index 8814e96..2056777 100644 --- a/src/bridge/windows.rs +++ b/src/bridge/windows.rs @@ -8,7 +8,7 @@ extern { pub fn get_active_window_executable(buffer: *mut u16, size: i32) -> i32; // UI - pub fn initialize_notification(icon_path: *const u16) -> i32; + pub fn initialize_ui(icon_path: *const u16) -> i32; pub fn show_notification(message: *const u16) -> i32; pub fn close_notification(); diff --git a/src/ui/windows.rs b/src/ui/windows.rs index 520c9ed..563ed7b 100644 --- a/src/ui/windows.rs +++ b/src/ui/windows.rs @@ -1,5 +1,5 @@ use std::process::Command; -use crate::bridge::windows::{show_notification, close_notification, initialize_notification}; +use crate::bridge::windows::{show_notification, close_notification, initialize_ui}; use widestring::U16CString; use std::{fs, thread, time}; use log::{info, debug}; @@ -69,7 +69,7 @@ impl WindowsUIManager { thread::spawn(move || { unsafe { - initialize_notification(icon_file_c.as_ptr()); + initialize_ui(icon_file_c.as_ptr()); } });