Skip to content

Navigation Menu

Sign in
Sign up

[Windows] Implement basic platform view. - #90

Open
hanswered wants to merge 1 commit into
gioui:main from
hanswered:main
Open

[Windows] Implement basic platform view. #90
hanswered wants to merge 1 commit into
gioui:main from
hanswered:main

Conversation

@hanswered

@hanswered hanswered commented Jul 21, 2022
edited
Loading

Copy link
Copy Markdown

This is my implementation of win32 platform view.
To fix https://todo.sr.ht/~eliasnaur/gio/428

@hanswered hanswered changed the title (削除) Implement basic platform view. (削除ここまで) (追記) [Windows] Implement basic platform view. (追記ここまで) Jul 22, 2022

Copy link
Copy Markdown
Contributor

It seems to me you only need the effective position to implement LinkedViewOp in the client. If so, I wonder whether a lightweight transform feedback machanism would suffice:

package op
// TransformFeedbackOp can retrieve the transformation effective
// at the point of recording into the frame.
type TransformFeedbackOp struct {
 // Transform is filled in with the transformation during processing
 // of the frame the op is recorded into. Transform must not be nil.
 Transform *f32.Affine2D
}

Then, app.Window.Frame will, through the router, fill in Transforms during frame processing where transforms are realized. And you can use the usual app.ViewEvent to update your embedded view.

WDYT?

Copy link
Copy Markdown
Author

WDYT?

I didn't observe any bottle-neck calling MoveWindow every frame. In case of lightweight code...
As long as link.Move(...) is called whenever it's expected boundary changes, things should be fine 🔥

Copy link
Copy Markdown
Contributor

WDYT?

I didn't observe any bottle-neck calling MoveWindow every frame. In case of lightweight code... As long as link.Move(...) is called whenever it's expected boundary changes, things should be fine 🔥

What did you think of the rest of my proposal? If it's acceptable, we can avoid having any extra paltform specific code in Gio to support native windows.

Copy link
Copy Markdown
Author

WDYT?

I didn't observe any bottle-neck calling MoveWindow every frame. In case of lightweight code... As long as link.Move(...) is called whenever it's expected boundary changes, things should be fine 🔥

What did you think of the rest of my proposal? If it's acceptable, we can avoid having any extra paltform specific code in Gio to support native windows.

To support native window GIO should have platform view api available to it. Since GIO app is expected run on multiple platforms this could be more useful in the long run.
I think I can change some platform specific API calls to that are already available in GIO.

Copy link
Copy Markdown
Author

And I also think that having a pointer passed around just for knowing it's boundary a little bit much. But for convenience we may want GIO to know about the underlying platform code.

Copy link
Copy Markdown
Contributor

WDYT?

I didn't observe any bottle-neck calling MoveWindow every frame. In case of lightweight code... As long as link.Move(...) is called whenever it's expected boundary changes, things should be fine 🔥

What did you think of the rest of my proposal? If it's acceptable, we can avoid having any extra paltform specific code in Gio to support native windows.

To support native window GIO should have platform view api available to it. Since GIO app is expected run on multiple platforms this could be more useful in the long run. I think I can change some platform specific API calls to that are already available in GIO.

I'm don't think the platform view API belongs in Gio if it doesn't need to. Like most other projects, we should be diligent about not increasing the long-term maintenance burden, and platform code is always the most troublesome to maintain.

Copy link
Copy Markdown
Author

I think having some examples based around it might be enough.

whereswaldon force-pushed the main branch 2 times, most recently from 67c77c9 to 46cc311 Compare May 30, 2024 08:05
whereswaldon force-pushed the main branch 2 times, most recently from f8029f2 to 026d3f9 Compare June 20, 2024 07:54
whereswaldon force-pushed the main branch 10 times, most recently from 632a44d to 072d68c Compare June 27, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /