Skip to content

Commit

Permalink
add system tray state IME state and debug console control
Browse files Browse the repository at this point in the history
  • Loading branch information
fanlumaster committed Oct 22, 2023
1 parent dbd51ec commit e74cc01
Show file tree
Hide file tree
Showing 13 changed files with 1,018 additions and 362 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
BasedOnStyle: Microsoft
IndentWidth: 4

# 不要给头文件排序
SortIncludes: false
Empty file added .clangd
Empty file.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/src/backupciku
/src/flyciku.db
/draftUtils
/draftWin32
/draftWin32*
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include_directories("${CMAKE_SOURCE_DIR}/src")
# 指定 sqlite dll 和 lib 文件路径
link_directories("${CMAKE_SOURCE_DIR}/libs/sqlite")

add_executable(fullcpp WIN32 "main.cpp" "./src/ui/cand_ui.cpp" "./src/hook/ime_hook.cpp" "./src/sqlite/sqlite_wrapper.cpp" "./flypytblsqlite.cpp" "./src/utils/caret_helper.cpp" "./src/hook/key_handle_func_lib.cpp" "./uiaccess.cpp" "DeclareDPIAware.manifest")
add_executable(fullcpp WIN32 "main.cpp" "./src/ui/cand_ui.cpp" "./src/hook/ime_hook.cpp" "./src/sqlite/sqlite_wrapper.cpp" "./flypytblsqlite.cpp" "./src/utils/caret_helper.cpp" "./src/hook/key_handle_func_lib.cpp" "./uiaccess.cpp" "./Resource.h" "./NotificationIcon.rc" "DeclareDPIAware.manifest")

# add_executable(fullcpp WIN32 "main.cpp" "./src/ui/cand_ui.cpp" "./src/hook/ime_hook.cpp" "./src/sqlite/sqlite_wrapper.cpp" "./flypytblsqlite.cpp" "./src/utils/caret_helper.cpp" "./src/hook/key_handle_func_lib.cpp" "./UIAccess.manifest")

Expand Down
Binary file added ENG.ico
Binary file not shown.
Binary file added NotificationIcon.ico
Binary file not shown.
130 changes: 130 additions & 0 deletions NotificationIcon.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
//Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1252)

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.

IDI_NOTIFICATIONICON ICON "NotificationIcon.ico"
IDI_CHINESEICON ICON "RIME.ico"
IDI_ENGLISHICON ICON "ENG.ico"

IDB_PRINTER BITMAP "printer.bmp"

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDC_NOTIFICATIONICON MENU
BEGIN
POPUP "&Test"
BEGIN
MENUITEM "Simulate Low Ink", IDM_LOWINK
MENUITEM "Simulate Print Job", IDM_PRINTJOB
MENUITEM "Simulate Out of ink", IDM_NOINK
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
END
END

IDC_CONTEXTMENU MENU
BEGIN
POPUP ""
BEGIN
MENUITEM "Show Flyout", IDM_FLYOUT
MENUITEM "Options", IDM_OPTIONS
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
END
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

2 TEXTINCLUDE
BEGIN
"#ifndef APSTUDIO_INVOKED\r\n"
"#include ""targetver.h""\r\n"
"#endif\r\n"
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

#endif // APSTUDIO_INVOKED

/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE
BEGIN
IDS_APP_TITLE "System Tray"
IDS_TOOLTIP "Printer icon"

IDS_LOWINK_TITLE "Low Ink"
IDS_LOWINK_TEXT "The printer is low on ink and print quality may be affected."

IDS_NOINK_TITLE "No Ink"
IDS_NOINK_TEXT "The printer is out of ink and unable to print."

IDS_PRINTJOB_TITLE "Print job"
IDS_PRINTJOB_TEXT "Your job has been sent to the printer."

END

#endif
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//

/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
Binary file added RIME.ico
Binary file not shown.
47 changes: 47 additions & 0 deletions Resource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by NotificationIcon.rc
//

#define IDS_APP_TITLE 103
#define IDS_TOOLTIP 104
#define IDS_LOWINK_TITLE 105
#define IDS_LOWINK_TEXT 106
#define IDS_NOINK_TITLE 107
#define IDS_NOINK_TEXT 108
#define IDS_PRINTJOB_TITLE 109
#define IDS_PRINTJOB_TEXT 110

#define IDR_MAINFRAME 128

#define IDM_LOWINK 121
#define IDM_PRINTJOB 122
#define IDM_NOINK 123
#define IDM_EXIT 124
#define IDM_OPTIONS 125
#define IDM_FLYOUT 126

#define IDI_NOTIFICATIONICON 207
#define IDC_NOTIFICATIONICON 208
#define IDC_CONTEXTMENU 209

#define IDI_CHINESEICON 210
#define IDI_ENGLISHICON 211

#define IDC_MYICON 2
#define IDB_PRINTER 110
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
1 change: 1 addition & 0 deletions launch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if ($LASTEXITCODE -eq 0)
$contentInParentheses = $Matches[1]
$result = -split $contentInParentheses
$exePath = "./build/DEBUG/" + $result[0] + ".exe"
Write-Host "start running..."
Invoke-Expression $exePath
}
}
Expand Down
Loading

0 comments on commit e74cc01

Please sign in to comment.