-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement mouse cursors in EFL driver
- Loading branch information
1 parent
3b945fb
commit 17515a7
Showing
9 changed files
with
155 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// +build !ci,efl | ||
|
||
// +build linux openbsd freebsd netbsd | ||
|
||
// +build !wayland | ||
|
||
package efl | ||
|
||
// #cgo pkg-config: ecore-evas ecore-x | ||
// #include <Ecore_Evas.h> | ||
// #include <Ecore_X.h> | ||
// #include <Ecore_X_Cursor.h> | ||
import "C" | ||
import ( | ||
"fyne.io/fyne" | ||
"fyne.io/fyne/widget" | ||
) | ||
|
||
func oSEngineName() string { | ||
return "software_x11" | ||
} | ||
|
||
func oSWindowInit(w *window) { | ||
} | ||
|
||
func setCursor(w *window, object fyne.CanvasObject) { | ||
win := C.ecore_evas_software_x11_window_get(w.ee) | ||
|
||
cursor := C.ECORE_X_CURSOR_ARROW | ||
switch wid := object.(type) { | ||
case *widget.Entry: | ||
if !wid.ReadOnly { | ||
cursor = C.ECORE_X_CURSOR_XTERM | ||
} | ||
case *widget.Hyperlink: | ||
cursor = C.ECORE_X_CURSOR_HAND2 | ||
} | ||
|
||
C.ecore_x_window_cursor_set(win, C.ecore_x_cursor_shape_get(C.int(cursor))) | ||
} | ||
|
||
func unsetCursor(w *window, object fyne.CanvasObject) { | ||
win := C.ecore_evas_software_x11_window_get(w.ee) | ||
C.ecore_x_window_cursor_set(win, C.ECORE_X_CURSOR_ARROW) | ||
} |