Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
2426cca4
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2426cca4
编写于
1月 18, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
v2.3.24 Fixed Chinese input and gtk3 issues for linux packagin
上级
e9852f2b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
98 addition
and
111 deletion
+98
-111
cef/cef-browser-window-lcl_windows.go
cef/cef-browser-window-lcl_windows.go
+7
-6
cef/cef-def.go
cef/cef-def.go
+0
-105
cef/cef-def_windows.go
cef/cef-def_windows.go
+91
-0
未找到文件。
cef/cef-browser-window-lcl_windows.go
浏览文件 @
2426cca4
...
...
@@ -20,6 +20,8 @@ import (
"github.com/energye/golcl/lcl/win"
)
var
ov
=
version
.
OSVersion
//显示标题栏
func
(
m
*
LCLBrowserWindow
)
ShowTitle
()
{
win
.
SetWindowLong
(
m
.
Handle
(),
win
.
GWL_STYLE
,
uintptr
(
win
.
GetWindowLong
(
m
.
Handle
(),
win
.
GWL_STYLE
)
|
win
.
WS_CAPTION
))
...
...
@@ -32,18 +34,19 @@ func (m *LCLBrowserWindow) HideTitle() {
win
.
SetWindowPos
(
m
.
Handle
(),
m
.
Handle
(),
0
,
0
,
0
,
0
,
win
.
SWP_NOSIZE
|
win
.
SWP_NOMOVE
|
win
.
SWP_NOZORDER
|
win
.
SWP_NOACTIVATE
|
win
.
SWP_FRAMECHANGED
)
}
var
wdrs
=
&
windowDragRegionsState
{}
//windows 窗口拖拽区域管理
var
wdrs
=
&
windowDragRegions
{}
type
windowDragRegions
State
struct
{
type
windowDragRegions
struct
{
canCaption
bool
}
func
(
m
*
windowDragRegions
State
)
toPoint
(
message
*
types
.
TMessage
)
(
x
,
y
int32
)
{
func
(
m
*
windowDragRegions
)
toPoint
(
message
*
types
.
TMessage
)
(
x
,
y
int32
)
{
return
int32
(
message
.
LParam
&
0xFFFF
),
int32
(
message
.
LParam
&
0xFFFF0000
>>
16
)
}
//鼠标在标题栏区域
func
(
m
*
windowDragRegions
State
)
isCaption
(
hWND
types
.
HWND
,
rgn
*
HRGN
,
message
*
types
.
TMessage
)
(
x
,
y
int32
,
caption
bool
)
{
func
(
m
*
windowDragRegions
)
isCaption
(
hWND
types
.
HWND
,
rgn
*
HRGN
,
message
*
types
.
TMessage
)
(
x
,
y
int32
,
caption
bool
)
{
dx
,
dy
:=
m
.
toPoint
(
message
)
p
:=
&
types
.
TPoint
{
X
:
dx
,
...
...
@@ -54,8 +57,6 @@ func (m *windowDragRegionsState) isCaption(hWND types.HWND, rgn *HRGN, message *
return
p
.
X
,
p
.
Y
,
m
.
canCaption
}
var
ov
=
version
.
OSVersion
func
(
m
*
LCLBrowserWindow
)
doOnRenderCompMsg
(
message
*
types
.
TMessage
,
lResult
*
types
.
LRESULT
,
aHandled
*
bool
)
{
if
m
.
regions
!=
nil
&&
m
.
regions
.
RegionsCount
()
>
0
{
switch
message
.
Msg
{
...
...
cef/cef-def.go
浏览文件 @
2426cca4
...
...
@@ -10,10 +10,7 @@ package cef
import
(
"github.com/energye/energy/common"
"github.com/energye/energy/consts"
"github.com/energye/golcl/lcl/api"
"github.com/energye/golcl/lcl/types"
"unsafe"
)
var
(
...
...
@@ -38,105 +35,3 @@ func LibBuildVersion() string {
}
return
lib_build_version
}
func
WinCreateRectRgn
(
X1
,
Y1
,
X2
,
Y2
int32
)
*
HRGN
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_CreateRectRgn
)
.
Call
(
uintptr
(
X1
),
uintptr
(
Y1
),
uintptr
(
X2
),
uintptr
(
Y2
))
return
&
HRGN
{
instance
:
unsafe
.
Pointer
(
r1
),
}
}
return
nil
}
func
WinSetRectRgn
(
aRGN
*
HRGN
,
X1
,
Y1
,
X2
,
Y2
int32
)
bool
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_SetRectRgn
)
.
Call
(
uintptr
(
aRGN
.
instance
),
uintptr
(
X1
),
uintptr
(
Y1
),
uintptr
(
X2
),
uintptr
(
Y2
))
return
api
.
GoBool
(
r1
)
}
return
false
}
func
WinDeleteObject
(
aRGN
*
HRGN
)
bool
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_DeleteObject
)
.
Call
(
uintptr
(
aRGN
.
instance
))
return
api
.
GoBool
(
r1
)
}
return
false
}
func
WinCombineRgn
(
dest
,
src1
,
src2
*
HRGN
,
fnCombineMode
consts
.
RNGFnCombineMode
)
int32
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_CombineRgn
)
.
Call
(
uintptr
(
dest
.
instance
),
uintptr
(
src1
.
instance
),
uintptr
(
src2
.
instance
),
uintptr
(
fnCombineMode
))
return
int32
(
r1
)
}
return
0
}
func
WinPtInRegion
(
RGN
*
HRGN
,
X
,
Y
int32
)
bool
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_PtInRegion
)
.
Call
(
uintptr
(
RGN
.
instance
),
uintptr
(
X
),
uintptr
(
Y
))
return
api
.
GoBool
(
r1
)
}
return
false
}
func
WinScreenToClient
(
handle
types
.
HWND
,
p
*
types
.
TPoint
)
int32
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_ScreenToClient
)
.
Call
(
handle
,
uintptr
(
unsafe
.
Pointer
(
p
)))
return
int32
(
r1
)
}
return
0
}
func
WinClientToScreen
(
handle
types
.
HWND
,
p
*
types
.
TPoint
)
bool
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_ClientToScreen
)
.
Call
(
handle
,
uintptr
(
unsafe
.
Pointer
(
p
)))
return
api
.
GoBool
(
r1
)
}
return
false
}
func
WinDefWindowProc
(
handle
types
.
HWND
,
msg
types
.
UINT
,
wParam
types
.
WPARAM
,
lParam
types
.
LPARAM
)
types
.
LRESULT
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_DefWindowProc
)
.
Call
(
handle
,
uintptr
(
msg
),
wParam
,
lParam
)
return
types
.
LRESULT
(
r1
)
}
return
0
}
func
WinDefSubclassProc
(
handle
types
.
HWND
,
msg
types
.
UINT
,
wParam
types
.
WPARAM
,
lParam
types
.
LPARAM
)
types
.
LRESULT
{
if
common
.
IsWindows
()
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_DefSubclassProc
)
.
Call
(
handle
,
uintptr
(
msg
),
wParam
,
lParam
)
return
types
.
LRESULT
(
r1
)
}
return
0
}
func
WinOnPaint
(
handle
types
.
HWND
)
{
if
common
.
IsWindows
()
{
common
.
Proc
(
internale_CEF_Win_OnPaint
)
.
Call
(
handle
)
}
}
func
WinSetDraggableRegions
(
aRGN
*
HRGN
,
regions
[]
TCefDraggableRegion
)
{
/*
//SetDraggableRegions 代码实现
draggableRegion := WinCreateRectRgn(0, 0, 0, 0)
WinSetRectRgn(draggableRegion, 0, 0, 0, 0)
for i := 0; i < regions.RegionsCount(); i++ {
region := regions.Region(i)
creRGN := WinCreateRectRgn(region.Bounds.X, region.Bounds.Y, region.Bounds.X+region.Bounds.Width, region.Bounds.Y+region.Bounds.Height)
if region.Draggable {
WinCombineRgn(draggableRegion, draggableRegion, creRGN, consts.RGN_OR)
} else {
WinCombineRgn(draggableRegion, draggableRegion, creRGN, consts.RGN_DIFF)
}
WinDeleteObject(creRGN)
}
fmt.Println("Check PtInRegion:", WinPtInRegion(draggableRegion, 50, 50))
*/
if
common
.
IsWindows
()
{
common
.
Proc
(
internale_CEF_Win_SetDraggableRegions
)
.
Call
(
uintptr
(
aRGN
.
instance
),
uintptr
(
int32
(
len
(
regions
))),
uintptr
(
unsafe
.
Pointer
(
&
regions
[
0
])),
uintptr
(
int32
(
len
(
regions
))))
}
}
cef/cef-def_windows.go
0 → 100644
浏览文件 @
2426cca4
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under GNU General Public License v3.0
//
//----------------------------------------
//go:build windows
// +build windows
package
cef
import
(
"github.com/energye/energy/common"
"github.com/energye/energy/consts"
"github.com/energye/golcl/lcl/api"
"github.com/energye/golcl/lcl/types"
"unsafe"
)
func
WinCreateRectRgn
(
X1
,
Y1
,
X2
,
Y2
int32
)
*
HRGN
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_CreateRectRgn
)
.
Call
(
uintptr
(
X1
),
uintptr
(
Y1
),
uintptr
(
X2
),
uintptr
(
Y2
))
return
&
HRGN
{
instance
:
unsafe
.
Pointer
(
r1
),
}
}
func
WinSetRectRgn
(
aRGN
*
HRGN
,
X1
,
Y1
,
X2
,
Y2
int32
)
bool
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_SetRectRgn
)
.
Call
(
uintptr
(
aRGN
.
instance
),
uintptr
(
X1
),
uintptr
(
Y1
),
uintptr
(
X2
),
uintptr
(
Y2
))
return
api
.
GoBool
(
r1
)
}
func
WinDeleteObject
(
aRGN
*
HRGN
)
bool
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_DeleteObject
)
.
Call
(
uintptr
(
aRGN
.
instance
))
return
api
.
GoBool
(
r1
)
}
func
WinCombineRgn
(
dest
,
src1
,
src2
*
HRGN
,
fnCombineMode
consts
.
RNGFnCombineMode
)
int32
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_CombineRgn
)
.
Call
(
uintptr
(
dest
.
instance
),
uintptr
(
src1
.
instance
),
uintptr
(
src2
.
instance
),
uintptr
(
fnCombineMode
))
return
int32
(
r1
)
}
func
WinPtInRegion
(
RGN
*
HRGN
,
X
,
Y
int32
)
bool
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_PtInRegion
)
.
Call
(
uintptr
(
RGN
.
instance
),
uintptr
(
X
),
uintptr
(
Y
))
return
api
.
GoBool
(
r1
)
}
func
WinScreenToClient
(
handle
types
.
HWND
,
p
*
types
.
TPoint
)
int32
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_ScreenToClient
)
.
Call
(
handle
,
uintptr
(
unsafe
.
Pointer
(
p
)))
return
int32
(
r1
)
}
func
WinClientToScreen
(
handle
types
.
HWND
,
p
*
types
.
TPoint
)
bool
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_ClientToScreen
)
.
Call
(
handle
,
uintptr
(
unsafe
.
Pointer
(
p
)))
return
api
.
GoBool
(
r1
)
}
func
WinDefWindowProc
(
handle
types
.
HWND
,
msg
types
.
UINT
,
wParam
types
.
WPARAM
,
lParam
types
.
LPARAM
)
types
.
LRESULT
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_DefWindowProc
)
.
Call
(
handle
,
uintptr
(
msg
),
wParam
,
lParam
)
return
types
.
LRESULT
(
r1
)
}
func
WinDefSubclassProc
(
handle
types
.
HWND
,
msg
types
.
UINT
,
wParam
types
.
WPARAM
,
lParam
types
.
LPARAM
)
types
.
LRESULT
{
r1
,
_
,
_
:=
common
.
Proc
(
internale_CEF_Win_DefSubclassProc
)
.
Call
(
handle
,
uintptr
(
msg
),
wParam
,
lParam
)
return
types
.
LRESULT
(
r1
)
}
func
WinOnPaint
(
handle
types
.
HWND
)
{
common
.
Proc
(
internale_CEF_Win_OnPaint
)
.
Call
(
handle
)
}
func
WinSetDraggableRegions
(
aRGN
*
HRGN
,
regions
[]
TCefDraggableRegion
)
{
/*
//SetDraggableRegions 代码实现
draggableRegion := WinCreateRectRgn(0, 0, 0, 0)
WinSetRectRgn(draggableRegion, 0, 0, 0, 0)
for i := 0; i < regions.RegionsCount(); i++ {
region := regions.Region(i)
creRGN := WinCreateRectRgn(region.Bounds.X, region.Bounds.Y, region.Bounds.X+region.Bounds.Width, region.Bounds.Y+region.Bounds.Height)
if region.Draggable {
WinCombineRgn(draggableRegion, draggableRegion, creRGN, consts.RGN_OR)
} else {
WinCombineRgn(draggableRegion, draggableRegion, creRGN, consts.RGN_DIFF)
}
WinDeleteObject(creRGN)
}
fmt.Println("Check PtInRegion:", WinPtInRegion(draggableRegion, 50, 50))
*/
common
.
Proc
(
internale_CEF_Win_SetDraggableRegions
)
.
Call
(
uintptr
(
aRGN
.
instance
),
uintptr
(
int32
(
len
(
regions
))),
uintptr
(
unsafe
.
Pointer
(
&
regions
[
0
])),
uintptr
(
int32
(
len
(
regions
))))
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录