From 33c51eeee46982bfcb54e705d65b0c9e71e3d242 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 3 Oct 2023 22:44:11 +0900 Subject: [PATCH] internal/goglfw: remove files for macOS Updates #2776 --- internal/goglfw/cocoainit_darwin.go | 14 - internal/goglfw/cocoamonitor_darwin.go | 31 --- internal/goglfw/cocoaplatform_darwin.go | 22 -- internal/goglfw/cocoawindow_darwin.go | 246 ------------------ .../goglfw/{context.go => context_windows.go} | 2 - .../goglfw/{glfw3h.go => glfw3h_windows.go} | 2 - internal/goglfw/{init.go => init_windows.go} | 2 - .../goglfw/{input.go => input_windows.go} | 2 - .../{internal.go => internal_windows.go} | 2 - .../goglfw/{monitor.go => monitor_windows.go} | 2 - internal/goglfw/nsgl_darwin.go | 14 - internal/goglfw/posixthread_unix.go | 28 -- .../goglfw/{window.go => window_windows.go} | 2 - 13 files changed, 369 deletions(-) delete mode 100644 internal/goglfw/cocoainit_darwin.go delete mode 100644 internal/goglfw/cocoamonitor_darwin.go delete mode 100644 internal/goglfw/cocoaplatform_darwin.go delete mode 100644 internal/goglfw/cocoawindow_darwin.go rename internal/goglfw/{context.go => context_windows.go} (99%) rename internal/goglfw/{glfw3h.go => glfw3h_windows.go} (99%) rename internal/goglfw/{init.go => init_windows.go} (97%) rename internal/goglfw/{input.go => input_windows.go} (99%) rename internal/goglfw/{internal.go => internal_windows.go} (99%) rename internal/goglfw/{monitor.go => monitor_windows.go} (99%) delete mode 100644 internal/goglfw/nsgl_darwin.go delete mode 100644 internal/goglfw/posixthread_unix.go rename internal/goglfw/{window.go => window_windows.go} (99%) diff --git a/internal/goglfw/cocoainit_darwin.go b/internal/goglfw/cocoainit_darwin.go deleted file mode 100644 index 1c57e1122..000000000 --- a/internal/goglfw/cocoainit_darwin.go +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard -// SPDX-FileCopyrightText: 2006-2019 Camilla Löwy -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -package goglfw - -func platformInit() error { - panic("goglfw: platformInit is not implemented yet") -} - -func platformTerminate() error { - panic("goglfw: platformTerminate is not implemented yet") -} diff --git a/internal/goglfw/cocoamonitor_darwin.go b/internal/goglfw/cocoamonitor_darwin.go deleted file mode 100644 index a7476d6ed..000000000 --- a/internal/goglfw/cocoamonitor_darwin.go +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard -// SPDX-FileCopyrightText: 2006-2019 Camilla Löwy -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -package goglfw - -func (m *Monitor) platformGetMonitorPos() (xpos, ypos int, ok bool) { - // cocoa_monitor.m:L450 - panic("goglfw: Monitor.platformGetMonitorPos is not implemented yet") -} - -func (m *Monitor) platformGetMonitorContentScale() (xscale, yscale float32, err error) { - // cocoa_monitor.m:L464 - panic("goglfw: Monitor.platformGetMonitorContentScale is not implemented yet") -} - -func (m *Monitor) platformGetMonitorWorkarea() (xpos, ypos, width, height int) { - // cocoa_monitor.m:L486 - panic("goglfw: Monitor.platformGetMonitorWorkarea is not implemented yet") -} - -func (m *Monitor) platformAppendVideoModes(monitors []*VidMode) ([]*VidMode, error) { - // cocoa_monitor.m:L512 - panic("goglfw: Monitor.platformAppendVideoModes is not implemented yet") -} - -func (m *Monitor) platformGetVideoMode() *VidMode { - // cocoa_monitor.m:L552 - panic("goglfw: Monitor.platformGetVideoMode is not implemented yet") -} diff --git a/internal/goglfw/cocoaplatform_darwin.go b/internal/goglfw/cocoaplatform_darwin.go deleted file mode 100644 index d301fc4c6..000000000 --- a/internal/goglfw/cocoaplatform_darwin.go +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard -// SPDX-FileCopyrightText: 2006-2019 Camilla Löwy -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -package goglfw - -type platformWindowState struct { - // TODO: Implement this. -} - -type platformMonitorState struct { - // TODO: Implement this. -} - -type platformCursorState struct { - // TODO: Implement this. -} - -type platformLibraryWindowState struct { - // TODO: Implement this. -} diff --git a/internal/goglfw/cocoawindow_darwin.go b/internal/goglfw/cocoawindow_darwin.go deleted file mode 100644 index 3f28b9eb4..000000000 --- a/internal/goglfw/cocoawindow_darwin.go +++ /dev/null @@ -1,246 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard -// SPDX-FileCopyrightText: 2006-2019 Camilla Löwy -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -package goglfw - -func (w *Window) platformCreateWindow(wndconfig *wndconfig, ctxconfig *ctxconfig, fbconfig *fbconfig) error { - // cocoa_window.m:L898 - panic("goglfw: Window.platformCreateWindow is not implemented yet") -} - -func (w *Window) platformDestroyWindow() error { - // cocoa_window.m:L968 - panic("goglfw: Window.platformDestroyWindow is not implemented yet") -} - -func (w *Window) platformSetWindowTitle(title string) error { - // cocoa_window.m:L999 - panic("goglfw: Window.platformSetWindowTitle is not implemented yet") -} - -func (w *Window) platformSetWindowIcon(images []*Image) error { - // cocoa_window.m:L1010 - panic("goglfw: Window.platformSetWindowIcon is not implemented yet") -} - -func (w *Window) platformGetWindowPos() (xpos, ypos int, err error) { - // cocoa_window.m:L1016 - panic("goglfw: Window.platformGetWindowPos is not implemented yet") -} - -func (w *Window) platformSetWindowPos(xpos, ypos int) error { - // cocoa_window.m:L1031 - panic("goglfw: Window.platformSetWindowPos is not implemented yet") -} - -func (w *Window) platformGetWindowSize() (width, height int, err error) { - // cocoa_window.m:L1043 - panic("goglfw: Window.platformGetWindowSize is not implemented yet") -} - -func (w *Window) platformSetWindowSize(width, height int) error { - // cocoa_window.m:L1057 - panic("goglfw: Window.platformSetWindowSize is not implemented yet") -} - -func (w *Window) platformSetWindowSizeLimits(minwidth, minheight, maxwidth, maxheight int) error { - // cocoa_window.m:L1079 - panic("goglfw: Window.platformSetWindowSizeLimits is not implemented yet") -} - -func (w *Window) platformSetWindowAspectRatio(numer, denom int) error { - // cocoa_window.m:L1098 - panic("goglfw: Window.platformSetWindowAspectRatio is not implemented yet") -} - -func (w *Window) platformGetFramebufferSize() (width, height int, err error) { - // cocoa_window.m:L1108 - panic("goglfw: Window.platformGetFramebufferSize is not implemented yet") -} - -func (w *Window) platformGetWindowFrameSize() (left, top, right, bottom int, err error) { - // cocoa_window.m:L1123 - panic("goglfw: Window.platformGetWindowFrameSize is not implemented yet") -} - -func (w *Window) platformGetWindowContentScale() (xscale, yscale float32, err error) { - // cocoa_window.m:L1146 - panic("goglfw: Window.platformGetWindowContentScale is not implemented yet") -} - -func (w *Window) platformIconifyWindow() { - // cocoa_window.m:L1162 - panic("goglfw: Window.platformIconifyWindow is not implemented yet") -} - -func (w *Window) platformRestoreWindow() { - // cocoa_window.m:L1169 - panic("goglfw: Window.platformRestoreWindow is not implemented yet") -} - -func (w *Window) platformMaximizeWindow() error { - // cocoa_window.m:L1179 - panic("goglfw: Window.platformMaximizeWindow is not implemented yet") -} - -func (w *Window) platformShowWindow() { - // cocoa_window.m:L1187 - panic("goglfw: Window.platformShowWindow is not implemented yet") -} - -func (w *Window) platformHideWindow() { - // cocoa_window.m:L1194 - panic("goglfw: Window.platformHideWindow is not implemented yet") -} - -func (w *Window) platformRequestWindowAttention() { - // cocoa_window.m:L1201 - panic("goglfw: Window.platformRequestWindowAttention is not implemented yet") -} - -func (w *Window) platformFocusWindow() error { - // cocoa_window.m:L1208 - panic("goglfw: Window.platformFocusWindow is not implemented yet") -} - -func (w *Window) platformSetWindowMonitor(monitor *Monitor, xpos, ypos, width, height, refreshRate int) error { - // cocoa_window.m:L1220 - panic("goglfw: Window.platformSetWindowMonitor is not implemented yet") -} - -func (w *Window) platformWindowFocused() bool { - // cocoa_window.m:L1348 - panic("goglfw: platformWindowFocused is not implemented yet") -} - -func (w *Window) platformWindowIconified() bool { - // cocoa_window.m:L1355 - panic("goglfw: Window.platformWindowIconified is not implemented yet") -} - -func (w *Window) platformWindowVisible() bool { - // cocoa_window.m:L1362 - panic("goglfw: Window.platformWindowVisible is not implemented yet") -} - -func (w *Window) platformWindowMaximized() bool { - // cocoa_window.m:L1369 - panic("goglfw: Window.platformWindowMaximized is not implemented yet") -} - -func (w *Window) platformWindowHovered() (bool, error) { - // cocoa_window.m:L1381 - panic("goglfw: Window.platformWindowHovered is not implemented yet") -} - -func (w *Window) platformFramebufferTransparent() bool { - // cocoa_window.m:L1399 - panic("goglfw: Window.platformFramebufferTransparent is not implemented yet") -} - -func (w *Window) platformSetWindowResizable(enabled bool) error { - // cocoa_window.m:L1406 - panic("goglfw: Window.platformSetWindowResizable is not implemented yet") -} - -func (w *Window) platformSetWindowDecorated(enabled bool) error { - // cocoa_window.m:L1430 - panic("goglfw: Window.platformSetWindowDecorated is not implemented yet") -} - -func (w *Window) platformSetWindowFloating(enabled bool) error { - // cocoa_window.m:L1452 - panic("goglfw: Window.platformSetWindowFloating is not implemented yet") -} - -func (w *Window) platformSetWindowMousePassthrough(enabled bool) error { - panic("goglfw: Window.platformSetWindowMousePassthrough is not implemented yet") -} - -func (w *Window) platformGetWindowOpacity() (float32, error) { - // cocoa_window.m:L1462 - panic("goglfw: Window.platformGetWindowOpacity is not implemented yet") -} - -func (w *Window) platformSetWindowOpacity(opacity float32) error { - // cocoa_window.m:L1469 - panic("goglfw: Window.platformSetWindowOpacity is not implemented yet") -} - -func (w *Window) platformSetRawMouseMotion(enabled bool) error { - return nil -} - -func platformRawMouseMotionSupported() bool { - return false -} - -func platformPollEvents() error { - // cocoa_window.m:L1485 - panic("goglfw: platformPollEvents is not implemented yet") -} - -func platformWaitEvents() error { - // cocoa_window.m:L1507 - panic("goglfw: platformWaitEvents is not implemented yet") -} - -func platformWaitEventsTimeout(timeout float64) error { - // cocoa_window.m:L1528 - panic("goglfw: platformWaitEventsTimeout is not implemented yet") -} - -func platformPostEmptyEvent() error { - // cocoa_window.m:L1548 - panic("goglfw: platformPostEmptyEvent is not implemented yet") -} - -func (w *Window) platformGetCursorPos() (xpos, ypos float64, err error) { - // cocoa_window.m:L1569 - panic("goglfw: Window.platformGetCursorPos is not implemented yet") -} - -func (w *Window) platformSetCursorPos(xpos, ypos float64) error { - // cocoa_window.m:L1585 - panic("goglfw: Window.platformSetCursorPos is not implemented yet") -} - -func (w *Window) platformSetCursorMode(mode int) error { - // cocoa_window.m:L1621 - panic("goglfw: Window.platformSetMode is not implemented yet") -} - -func platformGetScancodeName(scancode int) (string, error) { - // cocoa_window.m:L1629 - panic("goglfw: platformGetScancodeName is not implemented yet") -} - -func platformGetKeyScancode(key Key) int { - // cocoa_window.m:L1678 - panic("goglfw: platformGetKeyScancode is not implemented yet") -} - -func (c *Cursor) platformCreateStandardCursor(shape StandardCursor) error { - // cocoa_window.m:L1727 - panic("goglfw: Cursor.platformCreateStandardCursor is not implemented yet") -} - -func (c *Cursor) platformDestroyCursor() error { - // cocoa_window.m:L1757 - panic("goglfw: Cursor.platformDestroyCursor is not implemented yet") -} - -func (w *Window) platformSetCursor(cursor *Cursor) error { - // cocoa_window.m:L1765 - panic("goglfw: Window.platformSetCursor is not implemented yet") -} - -func platformSetClipboardString(str string) error { - panic("goglfw: platformSetClipboardString is not implemented") -} - -func platformGetClipboardString() (string, error) { - panic("goglfw: platformGetClipboardString is not implemented") -} diff --git a/internal/goglfw/context.go b/internal/goglfw/context_windows.go similarity index 99% rename from internal/goglfw/context.go rename to internal/goglfw/context_windows.go index c0113c2b9..daa6c090c 100644 --- a/internal/goglfw/context.go +++ b/internal/goglfw/context_windows.go @@ -3,8 +3,6 @@ // SPDX-FileCopyrightText: 2006-2019 Camilla Löwy // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw import ( diff --git a/internal/goglfw/glfw3h.go b/internal/goglfw/glfw3h_windows.go similarity index 99% rename from internal/goglfw/glfw3h.go rename to internal/goglfw/glfw3h_windows.go index 9f6d7afb6..ee6ddbc38 100644 --- a/internal/goglfw/glfw3h.go +++ b/internal/goglfw/glfw3h_windows.go @@ -3,8 +3,6 @@ // SPDX-FileCopyrightText: 2006-2019 Camilla Löwy // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw const ( diff --git a/internal/goglfw/init.go b/internal/goglfw/init_windows.go similarity index 97% rename from internal/goglfw/init.go rename to internal/goglfw/init_windows.go index a856a15bc..53a0ba39a 100644 --- a/internal/goglfw/init.go +++ b/internal/goglfw/init_windows.go @@ -3,8 +3,6 @@ // SPDX-FileCopyrightText: 2006-2018 Camilla Löwy // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw func terminate() error { diff --git a/internal/goglfw/input.go b/internal/goglfw/input_windows.go similarity index 99% rename from internal/goglfw/input.go rename to internal/goglfw/input_windows.go index 95176d5d7..4e9a4bfcd 100644 --- a/internal/goglfw/input.go +++ b/internal/goglfw/input_windows.go @@ -3,8 +3,6 @@ // SPDX-FileCopyrightText: 2006-2019 Camilla Löwy // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw import ( diff --git a/internal/goglfw/internal.go b/internal/goglfw/internal_windows.go similarity index 99% rename from internal/goglfw/internal.go rename to internal/goglfw/internal_windows.go index a50cdaf90..1a80706d7 100644 --- a/internal/goglfw/internal.go +++ b/internal/goglfw/internal_windows.go @@ -3,8 +3,6 @@ // SPDX-FileCopyrightText: 2006-2019 Camilla Löwy // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw import ( diff --git a/internal/goglfw/monitor.go b/internal/goglfw/monitor_windows.go similarity index 99% rename from internal/goglfw/monitor.go rename to internal/goglfw/monitor_windows.go index 820b1d0ad..cec42fe40 100644 --- a/internal/goglfw/monitor.go +++ b/internal/goglfw/monitor_windows.go @@ -3,8 +3,6 @@ // SPDX-FileCopyrightText: 2006-2019 Camilla Löwy // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw import ( diff --git a/internal/goglfw/nsgl_darwin.go b/internal/goglfw/nsgl_darwin.go deleted file mode 100644 index e69505af7..000000000 --- a/internal/goglfw/nsgl_darwin.go +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard -// SPDX-FileCopyrightText: 2006-2019 Camilla Löwy -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -package goglfw - -type platformContextState struct { - // TODO: Implement this. -} - -type platformLibraryContextState struct { - // TODO: Implement this. -} diff --git a/internal/goglfw/posixthread_unix.go b/internal/goglfw/posixthread_unix.go deleted file mode 100644 index b66ba34b2..000000000 --- a/internal/goglfw/posixthread_unix.go +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2002-2006 Marcus Geelnard -// SPDX-FileCopyrightText: 2006-2019 Camilla Löwy -// SPDX-FileCopyrightText: 2023 The Ebitengine Authors - -//go:build darwin - -package goglfw - -type platformTLSState struct { - // TODO: Implement this. -} - -func (t *tls) create() error { - panic("goglfw: tls.create is not implemented yet") -} - -func (t *tls) destroy() error { - panic("goglfw: tls.destroy is not implemented yet") -} - -func (t *tls) get() (uintptr, error) { - panic("goglfw: tls.get is not implemented yet") -} - -func (t *tls) set(value uintptr) error { - panic("goglfw: tls.set is not implemented yet") -} diff --git a/internal/goglfw/window.go b/internal/goglfw/window_windows.go similarity index 99% rename from internal/goglfw/window.go rename to internal/goglfw/window_windows.go index 1ca0ad371..45ea5e4fe 100644 --- a/internal/goglfw/window.go +++ b/internal/goglfw/window_windows.go @@ -4,8 +4,6 @@ // SPDX-FileCopyrightText: 2012 Torsten Walluhn // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build darwin || windows - package goglfw import (