mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
DRYer
This commit is contained in:
29
kitty/cocoa_window.h
Normal file
29
kitty/cocoa_window.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* cocoa_window.h
|
||||
* Copyright (C) 2024 Kovid Goyal <kovid at kovidgoyal.net>
|
||||
*
|
||||
* Distributed under terms of the GPL3 license.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "data-types.h"
|
||||
|
||||
void cocoa_focus_window(void *w);
|
||||
long cocoa_window_number(void *w);
|
||||
void cocoa_create_global_menu(void);
|
||||
void cocoa_recreate_global_menu(void);
|
||||
void cocoa_system_beep(const char*);
|
||||
void cocoa_set_activation_policy(bool);
|
||||
bool cocoa_alt_option_key_pressed(unsigned long);
|
||||
void cocoa_toggle_secure_keyboard_entry(void);
|
||||
void cocoa_hide(void);
|
||||
void cocoa_clear_global_shortcuts(void);
|
||||
void cocoa_hide_others(void);
|
||||
void cocoa_minimize(void *w);
|
||||
void cocoa_set_uncaught_exception_handler(void);
|
||||
void cocoa_update_menu_bar_title(PyObject*);
|
||||
size_t cocoa_get_workspace_ids(void *w, size_t *workspace_ids, size_t array_sz);
|
||||
monotonic_t cocoa_cursor_blink_interval(void);
|
||||
bool cocoa_render_line_of_text(const char *text, const color_type fg, const color_type bg, uint8_t *rgba_output, const size_t width, const size_t height);
|
||||
extern uint8_t* render_single_ascii_char_as_mask(const char ch, size_t *result_width, size_t *result_height);
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "state.h"
|
||||
#include "cleanup.h"
|
||||
#include "monotonic.h"
|
||||
#include "cocoa_window.h"
|
||||
#include <Availability.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
21
kitty/glfw.c
21
kitty/glfw.c
@@ -11,26 +11,11 @@
|
||||
#include <structmember.h>
|
||||
#include "glfw-wrapper.h"
|
||||
#include "gl.h"
|
||||
#ifndef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#include "cocoa_window.h"
|
||||
#else
|
||||
#include "freetype_render_ui_text.h"
|
||||
#endif
|
||||
extern void cocoa_focus_window(void *w);
|
||||
extern long cocoa_window_number(void *w);
|
||||
extern void cocoa_create_global_menu(void);
|
||||
extern void cocoa_recreate_global_menu(void);
|
||||
extern void cocoa_system_beep(const char*);
|
||||
extern void cocoa_set_activation_policy(bool);
|
||||
extern bool cocoa_alt_option_key_pressed(unsigned long);
|
||||
extern void cocoa_toggle_secure_keyboard_entry(void);
|
||||
extern void cocoa_hide(void);
|
||||
extern void cocoa_clear_global_shortcuts(void);
|
||||
extern void cocoa_hide_others(void);
|
||||
extern void cocoa_minimize(void *w);
|
||||
extern void cocoa_set_uncaught_exception_handler(void);
|
||||
extern void cocoa_update_menu_bar_title(PyObject*);
|
||||
extern size_t cocoa_get_workspace_ids(void *w, size_t *workspace_ids, size_t array_sz);
|
||||
extern monotonic_t cocoa_cursor_blink_interval(void);
|
||||
|
||||
#define debug debug_rendering
|
||||
|
||||
typedef struct mouse_cursor {
|
||||
|
||||
Reference in New Issue
Block a user