Skip to content

Commit

Permalink
chore: remove RequestResolution method for Custom Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Aug 2, 2024
1 parent 5f7238b commit 627576a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
15 changes: 0 additions & 15 deletions controller_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ extern void _MaaAPICallbackAgent(MaaStringView msg, MaaStringView detailsJson, M
extern uint8_t _ConnectAgent(MaaTransparentArg handleArg);
extern uint8_t _RequestUUIDAgent(MaaTransparentArg handle_arg, MaaStringBufferHandle buffer);
extern uint8_t _RequestResolutionAgent(MaaTransparentArg handle_arg, int32_t* width, int32_t* height);
extern uint8_t _StartAppAgent(_GoString_ intent, MaaTransparentArg handle_arg);
extern uint8_t _StopAppAgent(_GoString_ intent, MaaTransparentArg handle_arg);
extern uint8_t _ScreencapAgent(MaaTransparentArg handle_arg, MaaImageBufferHandle buffer);
Expand Down Expand Up @@ -51,7 +50,6 @@ import (
type CustomControllerImpl interface {
Connect() bool
RequestUUID() (string, bool)
RequestResolution() (width, height int32, ok bool)
StartApp(intent string) bool
StopApp(intent string) bool
Screencap() (ImageBuffer, bool)
Expand All @@ -75,7 +73,6 @@ func NewCustomControllerHandler() CustomControllerHandler {
return CustomControllerHandler{handle: C.MaaCustomControllerHandleCreate(

Check failure on line 73 in controller_custom.go

View workflow job for this annotation

GitHub Actions / ubuntu (x86_64)

could not determine kind of name for C.MaaCustomControllerHandleCreate

Check failure on line 73 in controller_custom.go

View workflow job for this annotation

GitHub Actions / windows (x86_64)

could not determine kind of name for C.MaaCustomControllerHandleCreate

Check failure on line 73 in controller_custom.go

View workflow job for this annotation

GitHub Actions / macos (macos-13, x86_64)

could not determine kind of name for C.MaaCustomControllerHandleCreate

Check failure on line 73 in controller_custom.go

View workflow job for this annotation

GitHub Actions / macos (macos-14, aarch64)

could not determine kind of name for C.MaaCustomControllerHandleCreate
C.ConnectCallback(C._ConnectAgent),
C.RequestUUIDCallback(C._RequestUUIDAgent),
C.RequestResolutionCallback(C._RequestResolutionAgent),
C.StartAppCallback(C._StartAppAgent),
C.StopAppCallback(C._StopAppAgent),
C.ScreencapCallback(C._ScreencapAgent),
Expand Down Expand Up @@ -119,18 +116,6 @@ func _RequestUUIDAgent(handleArg C.MaaTransparentArg, buffer C.MaaStringBufferHa
return C.uint8_t(0)
}

//export _RequestResolutionAgent
func _RequestResolutionAgent(handleArg C.MaaTransparentArg, width, height *C.int32_t) C.uint8_t {
ctrl := *(*CustomControllerImpl)(unsafe.Pointer(handleArg))
w, h, ok := ctrl.RequestResolution()
if ok {
*width = C.int32_t(w)
*height = C.int32_t(h)
return C.uint8_t(1)
}
return C.uint8_t(0)
}

//export _StartAppAgent
func _StartAppAgent(intent string, handleArg C.MaaTransparentArg) C.uint8_t {
ctrl := *(*CustomControllerImpl)(unsafe.Pointer(handleArg))
Expand Down
6 changes: 0 additions & 6 deletions controller_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ typedef MaaBool (*ConnectCallback)(MaaTransparentArg handle_arg);
typedef MaaBool (
*RequestUUIDCallback)(MaaTransparentArg handle_arg, /* out */ MaaStringBufferHandle buffer);

/// Write result to width and height.
typedef MaaBool (*RequestResolutionCallback)(
MaaTransparentArg handle_arg,
/* out */ int32_t* width,
/* out */ int32_t* height);

typedef MaaBool (*StartAppCallback)(MaaStringView intent, MaaTransparentArg handle_arg);
typedef MaaBool (*StopAppCallback)(MaaStringView intent, MaaTransparentArg handle_arg);

Expand Down

0 comments on commit 627576a

Please sign in to comment.