Pixel-Composer/scripts/mac_window_init/mac_window_init.gml

64 lines
1.2 KiB
Plaintext
Raw Normal View History

2023-03-08 12:14:01 +01:00
enum WINDOW_DRAG_MODE {
2023-05-08 10:50:42 +02:00
_move = 1 << 0,
2023-03-08 12:14:01 +01:00
resize_n = 1 << 1,
resize_e = 1 << 2,
resize_s = 1 << 3,
resize_w = 1 << 4,
}
function mac_window_init() {
globalvar __win_is_maximized, __win_min_x, __win_min_y, __win_min_w, __win_min_h;
2023-03-21 12:50:08 +01:00
__win_delay = 2;
2023-03-08 12:14:01 +01:00
__win_is_dragging = 0;
__win_drag_mx = 0;
__win_drag_my = 0;
__win_drag_sx = 0;
__win_drag_sy = 0;
__win_drag_sw = 0;
__win_drag_sh = 0;
2023-12-12 06:40:29 +01:00
__win_to_dock = false;
2023-03-08 12:14:01 +01:00
__win_is_maximized = false;
__win_min_x = 0;
__win_min_y = 0;
__win_min_w = 0;
__win_min_h = 0;
2023-12-08 04:08:47 +01:00
2023-12-12 06:40:29 +01:00
_window_set_showborder(window_handle(), false);
2023-03-08 12:14:01 +01:00
}
function mac_window_maximize() {
if(__win_is_maximized) return;
__win_is_maximized = true;
__win_min_x = window_get_x();
__win_min_y = window_get_y();
__win_min_w = window_get_width();
__win_min_h = window_get_height();
var _w = display_get_width();
var _h = display_get_height();
room_width = _w;
room_height = _h;
display_set_gui_size(_w, _h);
2023-11-28 06:50:54 +01:00
winMan_setRect(0, 0, _w, _h);
2023-03-08 12:14:01 +01:00
display_refresh();
}
function mac_window_minimize() {
if(!__win_is_maximized) return;
__win_is_maximized = false;
2023-11-28 06:50:54 +01:00
winMan_setRect(__win_min_x, __win_min_y, __win_min_w, __win_min_h);
2023-03-08 12:14:01 +01:00
display_refresh();
2023-12-12 06:40:29 +01:00
}
function mac_window_dock() {
o_main.__win_to_dock = true;
2023-03-08 12:14:01 +01:00
}