Skip to content

Commit 103ac48

Browse files
authored
Merge pull request #363 from gnustep/documentation2
Add new documentation
2 parents 15481d3 + 1736d8f commit 103ac48

17 files changed

+2738
-236
lines changed

Headers/AppKit/NSButtonCell.h

Lines changed: 359 additions & 21 deletions
Large diffs are not rendered by default.

Headers/AppKit/NSButtonTouchBarItem.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,29 @@
6262
extern "C" {
6363
#endif
6464

65+
/**
66+
* NSButtonTouchBarItem provides a touch-optimized button control specifically
67+
* designed for Touch Bar interfaces. It extends the basic NSTouchBarItem
68+
* functionality to provide button-specific features such as titles, images,
69+
* colors, and action handling optimized for touch interaction.
70+
*
71+
* This Touch Bar item supports text labels with automatic font optimization
72+
* for Touch Bar display, icon and image display with appropriate sizing and
73+
* rendering, background colors and visual styling for touch interfaces,
74+
* target-action pattern for handling touch events, enabled/disabled state
75+
* management, and integration with accessibility services.
76+
*
77+
* The button automatically adapts its appearance for the Touch Bar environment
78+
* with optimized sizing and spacing for finger-based interaction, high-contrast
79+
* rendering for the Touch Bar display characteristics, dynamic type support for
80+
* accessibility and user preferences, and visual feedback for touch interactions
81+
* and state changes.
82+
*
83+
* NSButtonTouchBarItem is commonly used for primary actions and commands relevant
84+
* to the current context, quick access to frequently used application functions,
85+
* modal confirmations and secondary action options, and navigation and workflow
86+
* control within Touch Bar interfaces.
87+
*/
6588
APPKIT_EXPORT_CLASS
6689
@interface NSButtonTouchBarItem : NSTouchBarItem
6790

Headers/AppKit/NSCachedImageRep.h

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
NSCachedImageRep.h
33
44
Cached image representation.
@@ -7,7 +7,7 @@
77
88
Written by: Adam Fedor <fedor@colorado.edu>
99
Date: Feb 1996
10-
10+
1111
This file is part of the GNUstep GUI Library.
1212
1313
This library is free software; you can redistribute it and/or
@@ -22,10 +22,10 @@
2222
2323
You should have received a copy of the GNU Lesser General Public
2424
License along with this library; see the file COPYING.LIB.
25-
If not, see <http://www.gnu.org/licenses/> or write to the
26-
Free Software Foundation, 51 Franklin Street, Fifth Floor,
25+
If not, see <http://www.gnu.org/licenses/> or write to the
26+
Free Software Foundation, 51 Franklin Street, Fifth Floor,
2727
Boston, MA 02110-1301, USA.
28-
*/
28+
*/
2929

3030
#ifndef _GNUstep_H_NSCachedImageRep
3131
#define _GNUstep_H_NSCachedImageRep
@@ -36,6 +36,25 @@
3636

3737
@class NSWindow;
3838

39+
/**
40+
* NSCachedImageRep is a specialized image representation that stores
41+
* cached bitmap data for efficient drawing operations. It provides a
42+
* way to capture and cache the visual content of windows or specific
43+
* rectangular areas as bitmap images, enabling fast redrawing and
44+
* composition operations without regenerating complex graphics content.
45+
*
46+
* This class is particularly useful for performance optimization in
47+
* scenarios where the same graphical content needs to be drawn repeatedly,
48+
* such as during window dragging, animation sequences, or when implementing
49+
* custom drawing caches. The cached representation can be created from
50+
* existing window content or initialized as an empty bitmap with specific
51+
* characteristics.
52+
*
53+
* NSCachedImageRep supports various pixel formats and color depths,
54+
* allowing for optimization based on the specific requirements of the
55+
* cached content. It can handle both separate and planar pixel formats,
56+
* with optional alpha channel support for transparency effects.
57+
*/
3958
APPKIT_EXPORT_CLASS
4059
@interface NSCachedImageRep : NSImageRep
4160
{
@@ -45,11 +64,20 @@ APPKIT_EXPORT_CLASS
4564
}
4665

4766
//
48-
// Initializing an NSCachedImageRep
67+
// Initializing an NSCachedImageRep
4968
//
5069

5170
/**
5271
* GNUstep extension
72+
*
73+
* Initializes a new cached image representation with the specified
74+
* dimensions and pixel characteristics. This extended initializer
75+
* provides additional control over the pixel format by allowing
76+
* specification of both logical size and actual pixel dimensions,
77+
* enabling support for high-resolution displays and custom pixel
78+
* densities. The depth parameter controls color depth and pixel
79+
* format, while separate and alpha flags determine memory layout
80+
* and transparency support respectively.
5381
*/
5482
- (id) initWithSize: (NSSize)aSize
5583
pixelsWide: (NSInteger)pixelsWide
@@ -58,17 +86,48 @@ APPKIT_EXPORT_CLASS
5886
separate: (BOOL)separate
5987
alpha: (BOOL)alpha;
6088

89+
/**
90+
* Initializes a new cached image representation with the specified
91+
* size and pixel characteristics. This creates an empty bitmap cache
92+
* with the given logical size and pixel format properties. The depth
93+
* parameter determines the color depth and pixel format, while the
94+
* separate flag controls whether pixels are stored in separate planes
95+
* or interleaved format. The alpha flag enables transparency support
96+
* by including an alpha channel in the pixel format.
97+
*/
6198
- (id)initWithSize:(NSSize)aSize
6299
depth:(NSWindowDepth)aDepth
63100
separate:(BOOL)separate
64101
alpha:(BOOL)alpha;
102+
/**
103+
* Initializes a cached image representation by capturing the contents
104+
* of a specific rectangular area within the given window. This method
105+
* creates a bitmap cache by copying the current visual content of the
106+
* specified rectangle from the window's backing store. The cached
107+
* representation can then be used for efficient redrawing operations
108+
* without requiring regeneration of the original content.
109+
*/
65110
- (id)initWithWindow:(NSWindow *)aWindow
66111
rect:(NSRect)aRect;
67112

68113
//
69-
// Getting the Representation
114+
// Getting the Representation
70115
//
116+
/**
117+
* Returns the rectangular area that was cached from the original window.
118+
* This rectangle represents the bounds of the content that was captured
119+
* when the cached image representation was created using the window-based
120+
* initializer. The rectangle is specified in the coordinate system of
121+
* the original window from which the content was cached.
122+
*/
71123
- (NSRect)rect;
124+
/**
125+
* Returns the window from which this cached image representation was
126+
* created. This provides access to the original source window that
127+
* was used to capture the cached content. Returns nil if the cached
128+
* image representation was created using size-based initialization
129+
* rather than window content capture.
130+
*/
72131
- (NSWindow *)window;
73132

74133
@end

0 commit comments

Comments
 (0)