diff --git a/content/examples/animation.md b/content/examples/animation.md index 5d84abe..62586b4 100644 --- a/content/examples/animation.md +++ b/content/examples/animation.md @@ -274,7 +274,7 @@ fn section(colors: &Colors, title: &'static str, content: impl IntoElement) -> i } fn main() { - Application::new() + gpui_platform::application() .with_assets(Assets {}) .run(|cx: &mut App| { let bounds = Bounds::centered(None, gpui_size(px(500.), px(650.)), cx); diff --git a/content/examples/async_tasks.md b/content/examples/async_tasks.md index 5fe8645..1fc1765 100644 --- a/content/examples/async_tasks.md +++ b/content/examples/async_tasks.md @@ -559,7 +559,7 @@ fn progress_bar(colors: &Colors, progress: u32) -> impl IntoElement { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(550.), px(850.)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/creating_components.md b/content/examples/creating_components.md index 55a518b..f87c401 100644 --- a/content/examples/creating_components.md +++ b/content/examples/creating_components.md @@ -432,7 +432,7 @@ impl Render for CreatingComponentsExample { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(700.), px(400.)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/custom_drawing.md b/content/examples/custom_drawing.md index 1e842bc..389d9ff 100644 --- a/content/examples/custom_drawing.md +++ b/content/examples/custom_drawing.md @@ -477,7 +477,7 @@ fn section( } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(550.), px(800.)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/data_table.md b/content/examples/data_table.md index 7385e59..ab1d720 100644 --- a/content/examples/data_table.md +++ b/content/examples/data_table.md @@ -461,7 +461,7 @@ impl Render for DataTable { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { cx.open_window( WindowOptions { focus: true, diff --git a/content/examples/interactive_elements.md b/content/examples/interactive_elements.md index c65d6ff..7af9a06 100644 --- a/content/examples/interactive_elements.md +++ b/content/examples/interactive_elements.md @@ -565,7 +565,7 @@ impl Render for InteractiveElementsExample { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(700.), px(650.)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/layout.md b/content/examples/layout.md index 9b9ee7b..3bcf3aa 100644 --- a/content/examples/layout.md +++ b/content/examples/layout.md @@ -497,7 +497,7 @@ fn section(colors: &Colors, title: &'static str, content: impl IntoElement) -> i } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(650.), px(700.)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/paths_bench.md b/content/examples/paths_bench.md index 78164ff..ceede2c 100644 --- a/content/examples/paths_bench.md +++ b/content/examples/paths_bench.md @@ -83,7 +83,7 @@ impl Render for PaintingViewer { } fn main() { - Application::new().run(|cx| { + gpui_platform::application().run(|cx| { cx.open_window( WindowOptions { titlebar: Some(TitlebarOptions { diff --git a/content/examples/pattern.md b/content/examples/pattern.md index ef51ac2..80ccd8a 100644 --- a/content/examples/pattern.md +++ b/content/examples/pattern.md @@ -113,7 +113,7 @@ impl Render for PatternExample { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(600.0), px(600.0)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/shadow.md b/content/examples/shadow.md index 2358cf2..e7a5ec7 100644 --- a/content/examples/shadow.md +++ b/content/examples/shadow.md @@ -583,7 +583,7 @@ impl Render for Shadow { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(1000.0), px(800.0)), cx); cx.open_window( WindowOptions { diff --git a/content/examples/styling.md b/content/examples/styling.md index 031706a..0651ef6 100644 --- a/content/examples/styling.md +++ b/content/examples/styling.md @@ -493,7 +493,7 @@ fn color_swatch(colors: &Colors, name: &'static str, color: Rgba) -> impl IntoEl } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { cx.activate(true); cx.on_action(|_: &Quit, cx| cx.quit()); cx.bind_keys([ diff --git a/content/examples/text.md b/content/examples/text.md index eefa90a..3457df2 100644 --- a/content/examples/text.md +++ b/content/examples/text.md @@ -580,7 +580,7 @@ fn section(colors: &Colors, title: &'static str, content: impl IntoElement) -> i } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(650.), px(900.)), cx); cx.open_window( WindowOptions { diff --git a/content/learn/getting-started.md b/content/learn/getting-started.md index 97cea2b..8f8558b 100644 --- a/content/learn/getting-started.md +++ b/content/learn/getting-started.md @@ -42,7 +42,8 @@ version = "0.1.0" edition = "2024" [dependencies] -gpui = { git = "https://github.com/zed-industries/zed" } +gpui = { git = "https://github.com/gpui-ce/gpui-ce" } +gpui_platform = { git = "https://github.com/gpui-ce/gpui-ce" } ``` > **Note:** GPUI is part of the Zed repository. Check the [GPUI Community Edition](https://github.com/nicholasoxford/gpui-ce) for a standalone version. @@ -59,7 +60,7 @@ Replace the contents of `src/main.rs` with: ```rust use gpui::{ - div, prelude::*, px, rgb, size, App, Application, Bounds, Context, + div, prelude::*, px, rgb, size, App, Bounds, Context, SharedString, Window, WindowBounds, WindowOptions, }; @@ -82,7 +83,7 @@ impl Render for HelloWorld { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(400.), px(300.)), cx); cx.open_window( @@ -113,13 +114,13 @@ Let's break this down piece by piece. ```rust fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { // ... }); } ``` -Every GPUI app starts with `Application::new().run(...)`. The closure receives an `App` context (`cx`), which is your gateway to the GPUI runtime. Through `cx`, you can: +Every GPUI app starts with `gpui_platform::application().run(...)`. The closure receives an `App` context (`cx`), which is your gateway to the GPUI runtime. Through `cx`, you can: - Open windows - Create entities (state containers) @@ -220,7 +221,7 @@ Now let's make something interactive. We'll build a counter that you can increme ```rust use gpui::{ - div, prelude::*, px, rgb, size, App, Application, Bounds, Context, + div, prelude::*, px, rgb, size, App, Bounds, Context, Window, WindowBounds, WindowOptions, }; @@ -297,7 +298,7 @@ impl Render for Counter { } fn main() { - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { let bounds = Bounds::centered(None, size(px(300.), px(200.)), cx); cx.open_window( @@ -508,7 +509,7 @@ Here's the complete counter with detailed comments: ```rust use gpui::{ - div, prelude::*, px, rgb, size, App, Application, Bounds, Context, + div, prelude::*, px, rgb, size, App, Bounds, Context, Window, WindowBounds, WindowOptions, }; @@ -598,7 +599,7 @@ impl Render for Counter { fn main() { // Create and run the application - Application::new().run(|cx: &mut App| { + gpui_platform::application().run(|cx: &mut App| { // Define window size and position let bounds = Bounds::centered(None, size(px(300.), px(200.)), cx);