Skip to content

Commit

Permalink
添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
XUANXUQAQ committed May 6, 2023
1 parent fdf3ef5 commit b79bdd6
Show file tree
Hide file tree
Showing 11 changed files with 252 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/file/engine/dllInterface/EmptyRecycleBin.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ public enum EmptyRecycleBin {
System.load(Path.of("user/emptyRecycleBin.dll").toAbsolutePath().toString());
}

/**
* Windows清空回收站API
*/
public native void emptyRecycleBin();
}
31 changes: 31 additions & 0 deletions src/main/java/file/engine/dllInterface/FileMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,46 @@ public enum FileMonitor {
System.load(Path.of("user/fileMonitor.dll").toAbsolutePath().toString());
}

/**
* 开始监控文件变化,该函数将会阻塞,直到stop_monitor被调用
*
* @param path 磁盘路径,C:\
*/
public native void monitor(String path);

/**
* 停止监控文件变化
*
* @param path 磁盘路径
*/
public native void stop_monitor(String path);

/**
* 监控是否已经停止或未开始
*
* @param path 磁盘路径
* @return true如果已经停止
*/
public native boolean is_monitor_stopped(String path);

/**
* 获取一个刚才新增的文件记录
*
* @return 文件路径
*/
public native String pop_add_file();

/**
* 获取一个刚才删除的文件记录
*
* @return 文件路径
*/
public native String pop_del_file();

/**
* 设置是否在程序退出时删除NTFS文件系统的USN日志
*
* @param path 磁盘盘符
*/
public native void delete_usn_on_exit(String path);
}
64 changes: 64 additions & 0 deletions src/main/java/file/engine/dllInterface/GetHandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,98 @@ public enum GetHandle {
System.load(Path.of("user/getHandle.dll").toAbsolutePath().toString());
}

/**
* 初始化
*/
public native void start();

/**
* 停止
*/
public native void stop();

/**
* 是否需要使搜索框切换到贴靠模式
*
* @return true如果当资源管理器获得了窗口焦点
*/
public native boolean changeToAttach();

/**
* 是否需要使搜索框切换到正常模式
*
* @return true如果资源管理器失去焦点或搜索框被关闭
*/
public native boolean changeToNormal();

/**
* 获取当前贴靠的资源管理器左上角X坐标
*
* @return X
*/
public native long getExplorerX();

/**
* 获取当前贴靠的资源管理器左上角Y坐标
*
* @return Y
*/
public native long getExplorerY();

/**
* 获取资源管理器窗口的宽度
*
* @return width
*/
public native long getExplorerWidth();

/**
* 获取资源管理器窗口的高度
*
* @return height
*/
public native long getExplorerHeight();

/**
* 获取资源管理器当前打开的文件夹的路径
*
* @return 文件夹路径
*/
public native String getExplorerPath();

/**
* 判断是否为对话框,比如选择文件弹出窗口
*
* @return true如果是对话框
*/
public native boolean isDialogWindow();

@Deprecated
public native int getToolBarX();

@Deprecated
public native int getToolBarY();

/**
* 判断键盘某个键是否被点击
*
* @param vk_key keyCode
* @return true如果被点击
*/
public native boolean isKeyPressed(int vk_key);

/**
* 判断当前是否有全屏任务,如游戏全屏,全屏看电影等
*
* @return true如果有
*/
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public native boolean isForegroundFullscreen();

/**
* 设置资源管理器上方文件夹路径,用于快速跳转
*
* @param path 文件夹路径
*/
public native void setEditPath(String path);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@ public enum GetWindowsKnownFolder {
System.load(Path.of("user/getWindowsKnownFolder.dll").toAbsolutePath().toString());
}

/**
* 根据guid获取文件夹路径
*
* @param guid guid
* @return 文件夹路径
* <a href="https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath">SHGetKnownFolderPath function (shlobj_core.h)</a>
* <a href="https://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid">knownfolderid</a>
*/
public native String getKnownFolder(String guid);
}
30 changes: 30 additions & 0 deletions src/main/java/file/engine/dllInterface/HotkeyListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,45 @@ public enum HotkeyListener {
System.load(Path.of("user/hotkeyListener.dll").toAbsolutePath().toString());
}

/**
* 注册全局快捷键
*
* @param key1 key1
* @param key2 key2
* @param key3 key3
* @param key4 key4
* @param key5 key5
*/
public native void registerHotKey(int key1, int key2, int key3, int key4, int key5);

/**
* 获取快捷键点击状态
*
* @return 当所有快捷键都被点击且没有多点击其他按键的情况下返回true,否则返回false
*/
public native boolean getKeyStatus();

/**
* 开始监听快捷键
*/
public native void startListen();

/**
* 停止监听快捷键
*/
public native void stopListen();

/**
* 是否ctrl被双击
*
* @return true如果被双击
*/
public native boolean isCtrlDoubleClicked();

/**
* 是否shift被双击
*
* @return true如果被双击
*/
public native boolean isShiftDoubleClicked();
}
12 changes: 12 additions & 0 deletions src/main/java/file/engine/dllInterface/IsLocalDisk.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ public enum IsLocalDisk {
System.load(Path.of("user/isLocalDisk.dll").toAbsolutePath().toString());
}

/**
* 判断是否是本地磁盘
*
* @param path 磁盘路径
* @return true如果是本地磁盘,false如果是U盘或移动硬盘
*/
public native boolean isLocalDisk(String path);

/**
* 磁盘文件系统是否为NTFS
*
* @param disk 磁盘路径
* @return true如果是NTFS
*/
public native boolean isDiskNTFS(String disk);
}
5 changes: 5 additions & 0 deletions src/main/java/file/engine/dllInterface/SystemThemeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ public enum SystemThemeInfo {
System.load(Path.of("user/systemThemeInfo.dll").toAbsolutePath().toString());
}

/**
* 判断Windows系统是否已开启暗色模式
*
* @return true如果是暗色模式
*/
public native boolean isDarkThemeEnabled();
}
Loading

0 comments on commit b79bdd6

Please sign in to comment.