Skip to content

Commit 1f41a90

Browse files
committed
Remove broadcast center and refactor macOS sources
- Delete broadcast_center and related files - Move macOS source files to impl/ directory - Update CMakeLists for new source paths - Refactor tray and menu macOS implementations - Add requirements and build instructions to README
1 parent 81408fb commit 1f41a90

21 files changed

+262
-216
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,60 @@
22

33
A cross-platform C++ library providing unified access to native system APIs.
44

5+
## Requirements
6+
7+
### Build Requirements
8+
9+
- CMake 3.10 or later
10+
- C++17 compatible compiler:
11+
- Windows: Visual Studio 2017 or later / MinGW-w64
12+
- macOS: Xcode 9.0 or later (Clang)
13+
- Linux: GCC 7.0+ or Clang 5.0+
14+
15+
### Platform-specific Dependencies
16+
17+
#### Linux
18+
19+
- GTK 3.0 development headers
20+
21+
```bash
22+
# Ubuntu/Debian
23+
sudo apt-get install libgtk-3-dev
24+
25+
# CentOS/RHEL/Fedora
26+
sudo yum install gtk3-devel
27+
# or
28+
sudo dnf install gtk3-devel
29+
```
30+
31+
#### macOS
32+
33+
- Cocoa framework (included with Xcode)
34+
35+
#### Windows
36+
37+
- Windows SDK
38+
39+
## Building from Source
40+
41+
### Quick Start
42+
43+
```bash
44+
# Clone the repository
45+
git clone https://github.com/leanflutter/libnativeapi.git
46+
cd libnativeapi
47+
48+
# Create build directory
49+
mkdir build
50+
cd build
51+
52+
# Configure and build
53+
cmake ..
54+
make -j$(nproc) # Linux/macOS
55+
# or
56+
cmake --build . --config Release # Windows
57+
```
58+
559
## Language Bindings
660

761
Currently available language bindings for libnativeapi:

examples/nswindow_example/main.mm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
#include <iostream>
44
#include "nativeapi.h"
55

6-
using nativeapi::BroadcastCenter;
7-
using nativeapi::BroadcastEventHandler;
86
using nativeapi::Display;
97
using nativeapi::DisplayEventHandler;
108
using nativeapi::DisplayManager;
119
using nativeapi::Tray;
1210
using nativeapi::TrayManager;
1311
using nativeapi::Window;
1412
using nativeapi::WindowManager;
13+
using nativeapi::Tray;
14+
using nativeapi::TrayManager;
15+
using nativeapi::Menu;
1516

1617
@interface AppDelegate : NSObject <NSApplicationDelegate>
1718
@property(strong) NSWindow* window;
@@ -115,4 +116,4 @@ int main(int argc, const char* argv[]) {
115116
[app run];
116117
}
117118
return 0;
118-
}
119+
}

include/nativeapi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

33
#include "../src/accessibility_manager.h"
4-
#include "../src/broadcast_center.h"
54
#include "../src/display.h"
65
#include "../src/display_manager.h"
76
#include "../src/geometry.h"

src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ list(FILTER COMMON_SOURCES EXCLUDE REGEX "linux.*|macos.*|windows.*")
2020

2121
# Platform-specific source files
2222
if(LINUX)
23-
file(GLOB PLATFORM_SOURCES "*_linux.cpp")
23+
file(GLOB PLATFORM_SOURCES "impl/*_linux.cpp")
2424
# Find GTK package for Linux
2525
find_package(PkgConfig REQUIRED)
2626
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
2727
elseif(APPLE)
28-
file(GLOB PLATFORM_SOURCES "*_macos.mm")
28+
file(GLOB PLATFORM_SOURCES "impl/*_macos.mm")
2929
elseif(WIN32)
30-
file(GLOB PLATFORM_SOURCES "*_windows.cpp")
30+
file(GLOB PLATFORM_SOURCES "impl/*_windows.cpp")
3131
else()
3232
set(PLATFORM_SOURCES "")
3333
endif()

src/broadcast_center.cpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/broadcast_center.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

src/broadcast_center_macos.mm

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "accessibility_manager.h"
1+
#include "../accessibility_manager.h"
22

33
// Import Cocoa headers
44
#import <Cocoa/Cocoa.h>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <gtk/gtk.h>
22
#include <iostream>
3-
#include "display_manager.h"
3+
#include "../display_manager.h"
44

55
namespace nativeapi {
66

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <string>
55
#include <vector>
66

7-
#include "display.h"
8-
#include "display_manager.h"
7+
#include "../display.h"
8+
#include "../display_manager.h"
99

1010
// Import Cocoa and Core Graphics headers
1111
#import <Cocoa/Cocoa.h>

0 commit comments

Comments
 (0)