]> git.eshelyaron.com Git - emacs.git/commit
Simplify NS color handling
authorAlan Third <alan@idiocy.org>
Sat, 14 Aug 2021 15:11:30 +0000 (16:11 +0100)
committerAlan Third <alan@idiocy.org>
Wed, 22 Dec 2021 20:48:19 +0000 (20:48 +0000)
commit0f427befe82f88237bdccbd528baf76f6d6485b0
treedffb5221ec905df3e78f147adbd4fced22e77118
parent5b0121b708986c836fa970b800387363806a035a
Simplify NS color handling

* src/image.c (RGB_TO_ULONG):
(ARGB_TO_ULONG):
(RED_FROM_ULONG):
(RED16_FROM_ULONG):
(GREEN16_FROM_ULONG):
(BLUE16_FROM_ULONG): Define these here for NS too.
* src/nsfns.m (ns_set_foreground_color):
(ns_set_background_color): Use new EmacsColor methods.
* src/nsterm.h (struct ns_color_table): Replace this struct with a
built-in Objective C type.
(RGB_TO_ULONG):
(ARGB_TO_ULONG):
(ALPHA_FROM_ULONG):
(RED_FROM_ULONG):
(GREEN_FROM_ULONG):
(BLUE_FROM_ULONG):
(RED16_FROM_ULONG):
(GREEN16_FROM_ULONG):
(BLUE16_FROM_ULONG): These are no longer needed in the NS specific code.
(struct ns_display_info): Use an NSMutableArray instead of a custom struct.
* src/nsterm.m ([NSColor colorWithUnsignedLong:hasAlpha:]):
([NSColor unsignedLong]): New methods.
(ns_lookup_indexed_color):
(ns_index_color): Use the NSMutableArray lookup table.
(ns_term_init):
(ns_color_index_to_rgba):
(ns_query_color): Use the new EmacsColor methods.
(ns_initialize_display_info):
(ns_delete_display): Initialize and release the NSMutableArray lookup table.
src/image.c
src/nsfns.m
src/nsterm.h
src/nsterm.m