~hanswer


#428 Windows Platform View 1 year, 4 months ago

Comment by ~hanswer on ~eliasnaur/gio

~psydvl have formatted code now but the strikethrough ~~ isn't working.

#428 Windows Platform View 1 year, 4 months ago

on ~eliasnaur/gio

~hanswer, for format text you should use Markdown (click to open)
  1. to create newline instead of keep text on previous line, use double space in the end of previous line
  2. to format inline code use `
    Like:
    I love `map[int]struct{}`
    
    Will produce:
    I love map[int]struct{}
  3. to format code block use triple ```
    Like:
    ``` go
    // This is main fucntion
    func main() {
        fmt.Println("Hello, world!")
    }
    ```
    
    Will produce
    // This is main fucntion
    func main() {
        fmt.Println("Hello, world!")
    }
    
    Instead of what we see now
  4. Also, preview button very useful, but you also can use any online markdown editor, like https://markdownlivepreview.com/

#428 Windows Platform View 1 year, 4 months ago

Comment by ~hanswer on ~eliasnaur/gio

POC is complete now. There is probably some code reviews needed.

-At this stage can I directly make a pull request on github?

-For the linkedView widget do I have move the code to gio/x repository?

#428 Windows Platform View 1 year, 5 months ago

Comment by ~hanswer on ~eliasnaur/gio

Was able to somehow use GIO offsets move window accurately just by having only one imageOP in (r *renderer) drawOps(). And then my idea was to write i.handle and recieve handle in drawOps(). Code below causes out of range panic.

(op *ClipOp) Decode(data []byte). const ops.TypeView ops.OpType = 208
// data := ops.Write1(&o.Internal, ops.TypeImageLen, i.handle) // data[0] = byte(ops.TypeView) }
func (i ViewOp) Add(o *op.Ops) {

I have no idea if this write1 usage is correct.

type ViewOp struct { handle interface{} area image.Point }

func NewViewOp(src interface{}, area image.Point) ViewOp { return ViewOp{handle: src, area: area} }

func (i ViewOp) Add(o *op.Ops) {

  data := ops.Write1(&o.Internal, ops.TypeImageLen, i.handle)
  data[0] = byte(ops.TypeView)
}

func (i ViewOp) Size() image.Point { return i.area }

#428 Windows Platform View 1 year, 5 months ago

Comment by ~hanswer on ~eliasnaur/gio

~inkeliz I already Parented a SDL window using app.ViewEvent shown on my mailing list. This way external window can only be moved in a predefined values. I expect the external window move to a specific placeholder image inside gio. I'm having a hard time figuring out how clip, offsets(relative to window) and dimension(of a placeholder image) can be calculated inside a widget. My guess we expose clip offsets in gtx.Constrains?

#428 Windows Platform View 1 year, 5 months ago

Ticket created by ~hanswer on ~eliasnaur/gio

Creating this todo after I was suggested from the mailing list: https://lists.sr.ht/~eliasnaur/gio/%3CCAEYLQcqLcsN7KdTUjoD7ZwdL0uLuEALqVB78enuz4iGcG-UkqQ%40mail.gmail.com%3E

There is few things should be done before seeing a working platform view. Currently GIO needs to be able to: -Parent a native window -Move native window relative to a placeholder image inside I can't figure out how to do this. https://gist.githubusercontent.com/hanswered/e0bc6bdd00db344683f36219c29ab8f6/raw/de802d8fabb72cbcbc68c8817167ea13ba0b2220/gistfile1.txt Other required functions are already available.

Later: -Overlay GIO on top of native window and vice versa. Transparency effects are undocumented but there might be an alternative way that I haven't yet explored https://docs.microsoft.com/en-us/archive/msdn-magazine/2014/june/windows-with-c-high-performance-window-layering-using-the-windows-composition-engine Optional: -An example of a native window with best practices of aquiring a handle (using os mutexes/ipc/something else?) -Starting and managing native window processes "UI friendly way".