LMMS
Loading...
Searching...
No Matches
swell-internal.h
Go to the documentation of this file.
1/* Cockos SWELL (Simple/Small Win32 Emulation Layer for Linux/OSX)
2 Copyright (C) 2006 and later, Cockos, Inc.
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19*/
20
21#ifndef _SWELL_INTERNAL_H_
22#define _SWELL_INTERNAL_H_
23
24#include "../ptrlist.h"
25
27{
28public:
30 ~SWELL_ListView_Row() { m_vals.Empty(true,free); }
32
35 int m_tmp; // Cocoa uses this temporarily, generic uses it as a mask (1= selected)
36};
37
38struct HTREEITEM__;
39
40#ifdef SWELL_TARGET_OSX
41
42#if 0
43 // at some point we should enable this and use it in most SWELL APIs that call Cocoa code...
44 #define SWELL_BEGIN_TRY @try {
45 #define SWELL_END_TRY(x) } @catch (NSException *ex) { NSLog(@"SWELL exception in %s:%d :: %@:%@\n",__FILE__,__LINE__,[ex name], [ex reason]); x }
46#else
47 #define SWELL_BEGIN_TRY
48 #define SWELL_END_TRY(x)
49#endif
50
51#define __SWELL_PREFIX_CLASSNAME3(a,b) a##b
52#define __SWELL_PREFIX_CLASSNAME2(a,b) __SWELL_PREFIX_CLASSNAME3(a,b)
53#define __SWELL_PREFIX_CLASSNAME(cname) __SWELL_PREFIX_CLASSNAME2(SWELL_APP_PREFIX,cname)
54
55// this defines interfaces to internal swell classes
56#define SWELL_hwndChild __SWELL_PREFIX_CLASSNAME(_hwnd)
57#define SWELL_hwndCarbonHost __SWELL_PREFIX_CLASSNAME(_hwndcarbonhost)
58
59#define SWELL_ModelessWindow __SWELL_PREFIX_CLASSNAME(_modelesswindow)
60#define SWELL_ModalDialog __SWELL_PREFIX_CLASSNAME(_dialogbox)
61
62#define SWELL_TextField __SWELL_PREFIX_CLASSNAME(_textfield)
63#define SWELL_ListView __SWELL_PREFIX_CLASSNAME(_listview)
64#define SWELL_TreeView __SWELL_PREFIX_CLASSNAME(_treeview)
65#define SWELL_TabView __SWELL_PREFIX_CLASSNAME(_tabview)
66#define SWELL_ProgressView __SWELL_PREFIX_CLASSNAME(_progind)
67#define SWELL_TextView __SWELL_PREFIX_CLASSNAME(_textview)
68#define SWELL_BoxView __SWELL_PREFIX_CLASSNAME(_box)
69#define SWELL_Button __SWELL_PREFIX_CLASSNAME(_button)
70#define SWELL_PopUpButton __SWELL_PREFIX_CLASSNAME(_pub)
71#define SWELL_ComboBox __SWELL_PREFIX_CLASSNAME(_cbox)
72
73#define SWELL_StatusCell __SWELL_PREFIX_CLASSNAME(_statuscell)
74#define SWELL_ListViewCell __SWELL_PREFIX_CLASSNAME(_listviewcell)
75#define SWELL_ODListViewCell __SWELL_PREFIX_CLASSNAME(_ODlistviewcell)
76#define SWELL_ODButtonCell __SWELL_PREFIX_CLASSNAME(_ODbuttoncell)
77#define SWELL_ImageButtonCell __SWELL_PREFIX_CLASSNAME(_imgbuttoncell)
78
79#define SWELL_FocusRectWnd __SWELL_PREFIX_CLASSNAME(_drawfocusrectwnd)
80
81#define SWELL_DataHold __SWELL_PREFIX_CLASSNAME(_sdh)
82#define SWELL_ThreadTmp __SWELL_PREFIX_CLASSNAME(_thread)
83#define SWELL_PopupMenuRecv __SWELL_PREFIX_CLASSNAME(_trackpopupmenurecv)
84
85#define SWELL_TimerFuncTarget __SWELL_PREFIX_CLASSNAME(_tft)
86
87
88#define SWELL_Menu __SWELL_PREFIX_CLASSNAME(_menu)
89
90#ifdef __OBJC__
91
92#ifndef MAC_OS_X_VERSION_10_7
93typedef struct _NSDraggingSession NSDraggingSession;
94#endif
95
96#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
97typedef int NSInteger;
98typedef unsigned int NSUInteger;
99#endif
100
101@interface SWELL_Menu : NSMenu
102{
103}
104-(void)dealloc;
105- (id)copyWithZone:(NSZone *)zone;
106@end
107
108@interface SWELL_DataHold : NSObject
109{
110 @public
111 void *m_data;
112}
113-(id) initWithVal:(void *)val;
114-(void *) getValue;
115@end
116
117@interface SWELL_TimerFuncTarget : NSObject
118{
119 TIMERPROC m_cb;
120 HWND m_hwnd;
121 UINT_PTR m_timerid;
122}
123-(id) initWithId:(UINT_PTR)tid hwnd:(HWND)h callback:(TIMERPROC)cb;
124-(void)SWELL_Timer:(id)sender;
125@end
126
127typedef struct OwnedWindowListRec
128{
129 NSWindow *hwnd;
130 struct OwnedWindowListRec *_next;
131} OwnedWindowListRec;
132
133typedef struct WindowPropRec
134{
135 char *name; // either <64k or a strdup'd name
136 void *data;
137 struct WindowPropRec *_next;
138} WindowPropRec;
139
140
141
142@interface SWELL_TextField : NSTextField
143{
144 @public
145 bool m_last_dark_mode;
146 bool m_ctlcolor_set;
147 bool m_disable_menu;
148}
149- (id) init;
150- (void)setNeedsDisplay:(BOOL)flag;
151- (void)setNeedsDisplayInRect:(NSRect)rect;
152- (void)drawRect:(NSRect)rect;
153- (void)initColors:(int)darkmode; // -1 to not update darkmode but trigger update of colors
154- (void)swellDisableContextMenu:(bool)dis;
155- (NSMenu *)textView:(NSTextView *)view menu:(NSMenu *)menu forEvent:(NSEvent *)event atIndex:(NSUInteger)charIndex;
156@end
157
158@interface SWELL_TabView : NSTabView
159{
160 NSInteger m_tag;
161 id m_dest;
162}
163@end
164
165@interface SWELL_ProgressView : NSProgressIndicator
166{
167 NSInteger m_tag;
168}
169@end
170
171@interface SWELL_ListViewCell : NSTextFieldCell
172{
173}
174-(NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
175- (NSRect)drawingRectForBounds:(NSRect)rect;
176@end
177
178@interface SWELL_StatusCell : SWELL_ListViewCell
179{
180 NSImage *status;
181}
182-(id)initNewCell;
183-(void)setStatusImage:(NSImage *)img;
184- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
185@end
186
187@interface SWELL_TreeView : NSOutlineView
188{
189 @public
190 bool m_fakerightmouse;
191 LONG style;
192 WDL_PtrList<HTREEITEM__> *m_items;
193 NSColor *m_fgColor;
194 NSMutableArray *m_selColors;
195}
196-(id) init;
197-(void) dealloc;
198-(bool) findItem:(HTREEITEM)item parOut:(HTREEITEM__ **)par idxOut:(int *)idx;
199-(void)mouseDown:(NSEvent *)theEvent;
200-(void)mouseDragged:(NSEvent *)theEvent;
201-(void)mouseUp:(NSEvent *)theEvent;
202- (void)rightMouseUp:(NSEvent *)theEvent;
203- (void)highlightSelectionInClipRect:(NSRect)theClipRect;
204
205// data source
206-(NSInteger) outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;
207- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
208- (id)outlineView:(NSOutlineView *)outlineView
209 child:(NSInteger)index
210 ofItem:(id)item;
211- (id)outlineView:(NSOutlineView *)outlineView
212 objectValueForTableColumn:(NSTableColumn *)tableColumn
213 byItem:(id)item;
214
215
216
217- (BOOL)outlineView:(NSOutlineView *)outlineView
218 writeItems:(NSArray *)items
219 toPasteboard:(NSPasteboard *)pasteboard;
220- (BOOL)outlineView:(NSOutlineView *)outlineView
221 acceptDrop:(id<NSDraggingInfo>)info
222 item:(id)item
223 childIndex:(NSInteger)index;
224- (void)outlineView:(NSOutlineView *)outlineView
225 draggingSession:(NSDraggingSession *)session
226 endedAtPoint:(NSPoint)screenPoint
227 operation:(NSDragOperation)operation;
228- (void)outlineView:(NSOutlineView *)outlineView
229 draggingSession:(NSDraggingSession *)session
230 willBeginAtPoint:(NSPoint)screenPoint
231 forItems:(NSArray *)draggedItems;
232- (NSDragOperation)outlineView:(NSOutlineView *)outlineView
233 validateDrop:(id<NSDraggingInfo>)info
234 proposedItem:(id)item
235 proposedChildIndex:(NSInteger)index;
236
237@end
238
239@interface SWELL_ListView : NSTableView
240{
241 int m_leftmousemovecnt;
242 bool m_fakerightmouse;
243 @public
244 LONG style;
245 int ownermode_cnt;
246 int m_start_item;
247 int m_start_subitem;
248 int m_start_item_clickmode;
249
250 int m_lbMode;
251 WDL_PtrList<SWELL_ListView_Row> *m_items;
252 WDL_PtrList<NSTableColumn> *m_cols;
253 WDL_PtrList<HGDIOBJ__> *m_status_imagelist;
254 int m_status_imagelist_type;
255 int m_fastClickMask;
256 NSColor *m_fgColor;
257 NSMutableArray *m_selColors;
258
259 // these are for the new yosemite mouse handling code
260 int m_last_plainly_clicked_item, m_last_shift_clicked_item;
261
262}
263-(LONG)getSwellStyle;
264-(void)setSwellStyle:(LONG)st;
265-(int)getSwellNotificationMode;
266-(void)setSwellNotificationMode:(int)lbMode;
267-(NSInteger)columnAtPoint:(NSPoint)pt;
268-(int)getColumnPos:(int)idx; // get current position of column that was originally at idx
269-(int)getColumnIdx:(int)pos; // get original index of column that is currently at position
270
271-(BOOL)accessibilityPerformShowMenu;
272@end
273
274@interface SWELL_ImageButtonCell : NSButtonCell
275{
276}
277- (NSRect)drawTitle:(NSAttributedString *)title withFrame:(NSRect)frame inView:(NSView *)controlView;
278@end
279
280@interface SWELL_ODButtonCell : NSButtonCell
281{
282}
283@end
284
285@interface SWELL_ODListViewCell : NSCell
286{
287 SWELL_ListView *m_ownctl;
288 int m_lastidx;
289}
290-(void)setOwnerControl:(SWELL_ListView *)t;
291-(void)setItemIdx:(int)idx;
292@end
293
294@interface SWELL_Button : NSButton
295{
296 void *m_swellGDIimage;
297 LONG_PTR m_userdata;
298 int m_radioflags;
299}
300-(int)swellGetRadioFlags;
301-(void)swellSetRadioFlags:(int)f;
302-(LONG_PTR)getSwellUserData;
303-(void)setSwellUserData:(LONG_PTR)val;
304-(void)setSwellGDIImage:(void *)par;
305-(void *)getSwellGDIImage;
306@end
307
308@interface SWELL_TextView : NSTextView
309{
310 NSInteger m_tag;
311 bool m_disable_menu;
312}
313-(id)init;
314-(NSInteger) tag;
315-(void) setTag:(NSInteger)tag;
316- (void)swellDisableContextMenu:(bool)dis;
317- (bool)swellWantsContextMenu;
318@end
319
320@interface SWELL_BoxView : NSBox
321{
322 NSInteger m_tag;
323@public
324 int m_etch_mode; // if nonzero, SS_ETCHEDHORZ etc
325}
326-(NSInteger) tag;
327-(void) setTag:(NSInteger)tag;
328-(void) drawRect:(NSRect)r;
329-(int) swellIsEtchBox;
330@end
331
332@interface SWELL_FocusRectWnd : NSView
333{
334}
335@end
336
337@interface SWELL_ThreadTmp : NSObject
338{
339@public
340 void *a, *b;
341}
342-(void)bla:(id)obj;
343@end
344
345
346
347@interface SWELL_hwndChild : NSView // <NSDraggingSource>
348{
349@public
350 int m_enabled; // -1 if preventing focus
351 DLGPROC m_dlgproc;
352 WNDPROC m_wndproc;
353 LONG_PTR m_userdata;
354 LONG_PTR m_extradata[32];
355 NSInteger m_tag;
356 int m_isfakerightmouse;
357 char m_hashaddestroy; // 2 = WM_DESTROY has finished completely
358 HMENU m_menu;
359 BOOL m_flip;
360 bool m_supports_ddrop;
361 bool m_paintctx_used;
362 HDC m_paintctx_hdc;
363 WindowPropRec *m_props;
364 NSRect m_paintctx_rect;
365 BOOL m_isopaque;
366 char m_titlestr[1024];
367 unsigned int m_create_windowflags;
368 NSOpenGLContext *m_glctx;
369 char m_isdirty; // &1=self needs redraw, &2=children may need redraw
370 char m_allow_nomiddleman;
371 id m_lastTopLevelOwner; // save a copy of the owner, if any
372 id m_access_cacheptrs[6];
373 const char *m_classname;
374
375// only used if not SWELL_NO_METAL
376 char m_use_metal; // 1=normal mode, 2=full pipeline (GetDC() etc support). -1 is for non-metal async layered mode. -2 for non-metal non-async layered
377
378 // metal state (if used)
379 char m_metal_dc_dirty; // used to track state during paint or getdc/releasedc. set to 1 if dirty, 2 if GetDC() but no write yet
380 char m_metal_gravity; // &1=resizing left, &2=resizing top
381 bool m_metal_retina; // last-retina-state, triggered to true by StretchBlt() with a 2:1 ratio
382
383 bool m_metal_in_needref_list;
384 RECT m_metal_in_needref_rect;
385 NSRect m_metal_lastframe;
386
387 id m_metal_texture; // id<MTLTexture> -- owned if in full pipeline mode, otherwise reference to m_metal_drawable
388 id m_metal_pipelineState; // id<MTLRenderPipelineState> -- only used in full pipeline mode
389 id m_metal_commandQueue; // id<MTLCommandQueue> -- only used in full pipeline mode
390 id m_metal_drawable; // id<CAMetalDrawable> -- only used in normal mode
391 id m_metal_device; // id<MTLDevice> -- set to last-used-device
392 DWORD m_metal_device_lastchkt;
393
394}
395- (id)initChild:(SWELL_DialogResourceIndex *)resstate Parent:(NSView *)parent dlgProc:(DLGPROC)dlgproc Param:(LPARAM)par;
396- (LRESULT)onSwellMessage:(UINT)msg p1:(WPARAM)wParam p2:(LPARAM)lParam;
397-(HANDLE)swellExtendedDragOp:(id <NSDraggingInfo>)sender retGlob:(BOOL)retG;
398- (const char *)onSwellGetText;
399-(void)onSwellSetText:(const char *)buf;
400-(LONG)swellGetExtendedStyle;
401-(void)swellSetExtendedStyle:(LONG)st;
402-(HMENU)swellGetMenu;
403-(BOOL)swellHasBeenDestroyed;
404-(void)swellSetMenu:(HMENU)menu;
405-(LONG_PTR)getSwellUserData;
406-(void)setSwellUserData:(LONG_PTR)val;
407-(void)setOpaque:(bool)isOpaque;
408-(LPARAM)getSwellExtraData:(int)idx;
409-(void)setSwellExtraData:(int)idx value:(LPARAM)val;
410-(void)setSwellWindowProc:(WNDPROC)val;
411-(WNDPROC)getSwellWindowProc;
412-(void)setSwellDialogProc:(DLGPROC)val;
413-(DLGPROC)getSwellDialogProc;
414
415- (NSArray*) namesOfPromisedFilesDroppedAtDestination:(NSURL*)droplocation;
416
417-(void) getSwellPaintInfo:(PAINTSTRUCT *)ps;
418- (int)swellCapChangeNotify;
419-(unsigned int)swellCreateWindowFlags;
420
421-(bool)swellCanPostMessage;
422-(int)swellEnumProps:(PROPENUMPROCEX)proc lp:(LPARAM)lParam;
423-(void *)swellGetProp:(const char *)name wantRemove:(BOOL)rem;
424-(int)swellSetProp:(const char *)name value:(void *)val ;
425-(NSOpenGLContext *)swellGetGLContext;
426- (void) setEnabledSwellNoFocus;
427-(const char *)getSwellClass;
428
429// NSAccessibility
430
431// attribute methods
432//- (NSArray *)accessibilityAttributeNames;
433- (id)accessibilityAttributeValue:(NSString *)attribute;
434//- (BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
435//- (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
436
437// parameterized attribute methods
438//- (NSArray *)accessibilityParameterizedAttributeNames;
439//- (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter;
440
441// action methods
442//- (NSArray *)accessibilityActionNames;
443//- (NSString *)accessibilityActionDescription:(NSString *)action;
444//- (void)accessibilityPerformAction:(NSString *)action;
445
446// Return YES if the UIElement doesn't show up to the outside world - i.e. its parent should return the UIElement's children as its own - cutting the UIElement out. E.g. NSControls are ignored when they are single-celled.
447- (BOOL)accessibilityIsIgnored;
448
449// Returns the deepest descendant of the UIElement hierarchy that contains the point. You can assume the point has already been determined to lie within the receiver. Override this method to do deeper hit testing within a UIElement - e.g. a NSMatrix would test its cells. The point is bottom-left relative screen coordinates.
450- (id)accessibilityHitTest:(NSPoint)point;
451
452// Returns the UI Element that has the focus. You can assume that the search for the focus has already been narrowed down to the reciever. Override this method to do a deeper search with a UIElement - e.g. a NSMatrix would determine if one of its cells has the focus.
453- (id)accessibilityFocusedUIElement;
454
455-(void) swellOnControlDoubleClick:(id)sender;
456
457#ifdef MAC_OS_X_VERSION_10_8
458// for radio button with the OSX 10.8+ SDK, see comment in SWELL_MakeControl
459-(void) onSwellCommand0:(id)sender;
460-(void) onSwellCommand2:(id)sender;
461-(void) onSwellCommand3:(id)sender;
462-(void) onSwellCommand4:(id)sender;
463-(void) onSwellCommand5:(id)sender;
464-(void) onSwellCommand6:(id)sender;
465-(void) onSwellCommand7:(id)sender;
466#endif
467
468-(BOOL) swellWantsMetal;
469-(void) swellDrawMetal:(const RECT *)forRect;
470@end
471
472@interface SWELL_ModelessWindow : NSWindow
473{
474@public
475 NSSize lastFrameSize;
476 id m_owner;
477 OwnedWindowListRec *m_ownedwnds;
478 BOOL m_enabled;
479 int m_wantraiseamt;
480 bool m_wantInitialKeyWindowOnShow;
481}
482- (id)initModeless:(SWELL_DialogResourceIndex *)resstate Parent:(HWND)parent dlgProc:(DLGPROC)dlgproc Param:(LPARAM)par outputHwnd:(HWND *)hwndOut forceStyles:(unsigned int)smask;
483- (id)initModelessForChild:(HWND)child owner:(HWND)owner styleMask:(unsigned int)smask;
484- (void)keyDown:(NSEvent *)event;
485- (void)swellDestroyAllOwnedWindows;
486- (void)swellRemoveOwnedWindow:(NSWindow *)wnd;
487- (void)swellAddOwnedWindow:(NSWindow*)wnd;
488- (void)swellSetOwner:(id)owner;
489- (id)swellGetOwner;
490- (void **)swellGetOwnerWindowHead;
491-(void)swellDoDestroyStuff;
492-(void)swellResetOwnedWindowLevels;
493
494-(void)toggleFullScreen:(id)sender;
495@end
496
497@interface SWELL_ModalDialog : NSPanel
498{
499 NSSize lastFrameSize;
500 id m_owner;
501 OwnedWindowListRec *m_ownedwnds;
502
503 int m_rv;
504 bool m_hasrv;
505 BOOL m_enabled;
506}
507- (id)initDialogBox:(SWELL_DialogResourceIndex *)resstate Parent:(HWND)parent dlgProc:(DLGPROC)dlgproc Param:(LPARAM)par;
508- (void)swellDestroyAllOwnedWindows;
509- (void)swellRemoveOwnedWindow:(NSWindow *)wnd;
510- (void)swellAddOwnedWindow:(NSWindow*)wnd;
511- (void)swellSetOwner:(id)owner;
512- (id)swellGetOwner;
513- (void **)swellGetOwnerWindowHead;
514-(void)swellDoDestroyStuff;
515
516-(void)swellSetModalRetVal:(int)r;
517-(int)swellGetModalRetVal;
518-(bool)swellHasModalRetVal;
519@end
520
521#ifndef SWELL_NO_METAL
522void swell_removeMetalDirty(SWELL_hwndChild *slf);
523void swell_updateAllMetalDirty(void);
524void swell_addMetalDirty(SWELL_hwndChild *slf, const RECT *r, bool isReleaseDC=false);
525HDC SWELL_CreateMetalDC(SWELL_hwndChild *);
526#endif
527
528
529@interface SWELL_hwndCarbonHost : SWELL_hwndChild
530#ifdef MAC_OS_X_VERSION_10_7
531<NSWindowDelegate>
532#endif
533{
534@public
535 NSWindow *m_cwnd;
536
537 bool m_whileresizing;
538 void* m_wndhandler; // won't compile if declared EventHandlerRef, wtf
539 void* m_ctlhandler; // not sure if these need to be separate but cant hurt
540 bool m_wantallkeys;
541}
542-(BOOL)swellIsCarbonHostingView;
543-(void)swellDoRepos;
544@end
545
546
547@interface SWELL_PopupMenuRecv : NSObject
548{
549 int m_act;
550 HWND cbwnd;
551}
552-(id) initWithWnd:(HWND)wnd;
553-(void) onSwellCommand:(id)sender;
554-(int) isCommand;
555- (void)menuNeedsUpdate:(NSMenu *)menu;
556
557@end
558
559@interface SWELL_PopUpButton : NSPopUpButton
560{
561 LONG m_style;
562}
563-(void)setSwellStyle:(LONG)style;
564-(LONG)getSwellStyle;
565@end
566
567@interface SWELL_ComboBox : NSComboBox
568{
569@public
570 LONG m_style;
571 WDL_PtrList<char> *m_ids;
572 int m_ignore_selchg; // used to track the last set selection state, to avoid getting feedback notifications
573 bool m_disable_menu;
574}
575-(id)init;
576-(void)dealloc;
577-(void)setSwellStyle:(LONG)style;
578-(LONG)getSwellStyle;
579- (void)swellDisableContextMenu:(bool)dis;
580- (NSMenu *)textView:(NSTextView *)view menu:(NSMenu *)menu forEvent:(NSEvent *)event atIndex:(NSUInteger)charIndex;
581@end
582
583
584
585// GDI internals
586
587#ifndef __AVAILABILITYMACROS__
588#error __AVAILABILITYMACROS__ not defined, include AvailabilityMacros.h!
589#endif
590
591// 10.4 doesn't support CoreText, so allow ATSUI if targetting 10.4 SDK
592#ifndef MAC_OS_X_VERSION_10_5
593 // 10.4 SDK
594 #define SWELL_NO_CORETEXT
595 #define SWELL_ATSUI_TEXT_SUPPORT
596#elif !defined(__LP64__)
597 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
598 #ifndef MAC_OS_X_VERSION_10_9 // not sure when ATSUI was dropped completely, definitely gone in 10.13!
599 #define SWELL_ATSUI_TEXT_SUPPORT
600 #endif
601 #endif
602#endif
603
604#ifndef MAC_OS_X_VERSION_10_11
605 // metal requires a recent SDK
606 #define SWELL_NO_METAL
607#endif
608
609struct HGDIOBJ__
610{
611 int type;
612
613 int additional_refcnt; // refcnt of 0 means one owner (if >0, additional owners)
614
615 // used by pen/brush
616 CGColorRef color;
617 int wid;
618 int color_int;
619 NSImage *bitmapptr;
620
621 NSMutableDictionary *__old_fontdict; // unused, for ABI compat
622 //
623 // if ATSUI used, meaning IsCoreTextSupported() returned false
624 ATSUStyle atsui_font_style;
625
626 float font_rotation;
627
628 bool _infreelist;
629 struct HGDIOBJ__ *_next;
630
631 // if using CoreText to draw text
632 void *ct_FontRef;
633};
634
635struct HDC__ {
636 CGContextRef ctx;
637 void *ownedData; // always use via SWELL_GetContextFrameBuffer() (which performs necessary alignment)
638 void *metal_ctx; // SWELL_hwndChild, only used if not SWELL_NO_METAL
639 HGDIOBJ__ *curpen;
640 HGDIOBJ__ *curbrush;
641 HGDIOBJ__ *curfont;
642
643 NSColor *__old_nstextcol; // provided for ABI compat, but unused
644 int cur_text_color_int; // text color as int
645
646 int curbkcol;
647 int curbkmode;
648 float lastpos_x,lastpos_y;
649
650 void *GLgfxctx; // optionally set
651 bool _infreelist;
652 struct HDC__ *_next;
653
654 CGColorRef curtextcol; // text color as CGColor
655};
656
657
658
659
660
661// some extras so we can call functions available only on some OSX versions without warnings, and with the correct types
662#define SWELL_DelegateExtensions __SWELL_PREFIX_CLASSNAME(_delext)
663#define SWELL_ViewExtensions __SWELL_PREFIX_CLASSNAME(_viewext)
664#define SWELL_AppExtensions __SWELL_PREFIX_CLASSNAME(_appext)
665#define SWELL_WindowExtensions __SWELL_PREFIX_CLASSNAME(_wndext)
666#define SWELL_TableColumnExtensions __SWELL_PREFIX_CLASSNAME(_tcolext)
667
668@interface SWELL_WindowExtensions : NSWindow
669-(void)setCollectionBehavior:(NSUInteger)a;
670@end
671@interface SWELL_ViewExtensions : NSView
672-(void)_recursiveDisplayRectIfNeededIgnoringOpacity:(NSRect)rect isVisibleRect:(BOOL)vr rectIsVisibleRectForView:(NSView*)v topView:(NSView *)v2;
673@end
674
675@interface SWELL_DelegateExtensions : NSObject
676-(bool)swellPostMessage:(HWND)dest msg:(int)message wp:(WPARAM)wParam lp:(LPARAM)lParam;
677-(void)swellPostMessageClearQ:(HWND)dest;
678-(void)swellPostMessageTick:(id)sender;
679@end
680
681@interface SWELL_AppExtensions : NSApplication
682-(NSUInteger)presentationOptions;
683-(void)setPresentationOptions:(NSUInteger)o;
684@end
685@interface SWELL_TableColumnExtensions : NSTableColumn
686-(BOOL)isHidden;
687-(void)setHidden:(BOOL)h;
688@end
689
690
691
692
693#else
694 // compat when compiling targetting OSX but not in objectiveC mode
695 struct SWELL_DataHold;
696#endif // !__OBJC__
697
698// 10.4 sdk just uses "float"
699#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
700 #ifdef __LP64__
701 typedef double CGFloat;
702 #else
703 typedef float CGFloat;
704#endif
705
706#endif
707
708
709#define NSPOINT_TO_INTS(pt) (int)floor((pt).x+0.5), (int)floor((pt).y+0.5)
710
711#ifdef __OBJC__
712static WDL_STATICFUNC_UNUSED void NSPOINT_TO_POINT(POINT *p, const NSPoint &pt)
713{
714 p->x = (int)floor(pt.x+0.5);
715 p->y = (int)floor((pt).y+0.5);
716}
717static WDL_STATICFUNC_UNUSED void NSRECT_TO_RECT(RECT *r, const NSRect &tr)
718{
719 r->left=(int)floor(tr.origin.x+0.5);
720 r->right=(int)floor(tr.origin.x+tr.size.width+0.5);
721 r->top=(int)floor(tr.origin.y+0.5);
722 r->bottom=(int)floor(tr.origin.y+tr.size.height+0.5);
723}
724#endif
725
726
727#ifdef SWELL_IMPLEMENT_GETOSXVERSION
728
729SWELL_IMPLEMENT_GETOSXVERSION int SWELL_GetOSXVersion()
730{
731 static SInt32 v;
732 if (!v)
733 {
734 if (NSAppKitVersionNumber >= 1266.0)
735 {
736 if (NSAppKitVersionNumber >= 2100.0)
737 v = 0x1200;
738 else if (NSAppKitVersionNumber >= 2022.0)
739 v = 0x1100;
740 else if (NSAppKitVersionNumber >= 1894.0)
741 v = 0x10e0;
742 else if (NSAppKitVersionNumber >= 1639.10)
743 v = 0x10d0;
744 else if (NSAppKitVersionNumber >= 1560)
745 v = 0x10c0;
746 else if (NSAppKitVersionNumber >= 1404.0)
747 v = 0x10b0;
748 else
749 v = 0x10a0; // 10.10+ Gestalt(gsv) return 0x109x, so we bump this to 0x10a0
750 }
751 else
752 {
753 SInt32 a = 0x1040;
754 Gestalt(gestaltSystemVersion,&a);
755 v=a;
756 }
757 }
758 return v;
759}
760
761#endif
762
763
764#elif defined(SWELL_TARGET_GDK)
765
766
767#ifdef SWELL_SUPPORT_GTK
768#include <gtk/gtk.h>
769#endif
770
771#include <gdk/gdk.h>
772#include <gdk/gdkkeysyms.h>
773#include <gdk/gdkx.h>
774
775
776#else
777// generic
778
779#endif // end generic
780
782{
785 bool FindItem(HTREEITEM it, HTREEITEM__ **parOut, int *idxOut);
786
787#ifdef SWELL_TARGET_OSX
788 SWELL_DataHold *m_dh;
789#else
790 int m_state; // TVIS_EXPANDED, for ex
791#endif
792
794 char *m_value;
795 WDL_PtrList<HTREEITEM__> m_children; // only used in tree mode
797};
798
799
800#ifndef SWELL_TARGET_OSX
801
802#include "../wdlstring.h"
803
804#ifdef SWELL_LICE_GDI
805#include "../lice/lice.h"
806#endif
807#include "../assocarray.h"
808
810
811
812#ifdef SWELL_TARGET_GDK
813typedef GdkWindow *SWELL_OSWINDOW;
814#else
815typedef void *SWELL_OSWINDOW; // maps to the HWND__ itself on visible, non-GDK, top level windows
816#endif
817
818struct HWND__
819{
820 HWND__(HWND par, int wID=0, const RECT *wndr=NULL, const char *label=NULL, bool visible=false, WNDPROC wndproc=NULL, DLGPROC dlgproc=NULL, HWND ownerWindow=NULL);
821 ~HWND__(); // DO NOT USE!!! We would make this private but it breaks PtrList using it on gcc.
822
823 // using this API prevents the HWND from being valid -- it'll still get its resources destroyed via DestroyWindow() though.
824 // DestroyWindow() does cleanup, then the final Release().
825 void Retain() { m_refcnt++; }
826 void Release() { if (!--m_refcnt) delete this; }
827
828 const char *m_classname;
829
831
832 WDL_FastString m_title;
833
836 HWND__ *m_focused_child; // only valid if hwnd itself is in focus chain, and must be validated before accessed
844 INT_PTR m_private_data; // used by internal controls
845
847 char m_hashaddestroy; // 1 in destroy, 2 full destroy
850
853 int m_oswindow_fullscreen; // may contain preserved style flags
854
856 int m_oswindow_private; // private state for generic-gtk or whatever
857
860
862
863#ifdef SWELL_LICE_GDI
864 void *m_paintctx; // temporarily set for calls to WM_PAINT
865
866 bool m_child_invalidated; // if a child is invalidated
867 bool m_invalidated; // set to true on direct invalidate. todo RECT instead?
868
869 LICE_IBitmap *m_backingstore; // if NULL, unused (probably only should use on top level windows, but support caching?)
870#endif
871};
872
874{
875 HMENU__() { m_refcnt=1; sel_vis = -1; }
876
877 void Retain() { m_refcnt++; }
878 void Release() { if (!--m_refcnt) delete this; }
879
881 int sel_vis; // for mouse/keyboard nav
883
885 static void freeMenuItem(void *p);
886
887private:
888 ~HMENU__() { items.Empty(true,freeMenuItem); }
889};
890
891
893{
894 int type;
895 int additional_refcnt; // refcnt of 0 means one owner (if >0, additional owners)
896
897 int color;
898 int wid;
899
900 float alpha;
901
904 void *typedata; // font: FT_Face, bitmap: LICE_IBitmap
905};
906
907
908struct HDC__ {
909#ifdef SWELL_LICE_GDI
910 LICE_IBitmap *surface; // owned by context. can be (and usually is, if clipping is desired) LICE_SubBitmap
911 POINT surface_offs; // offset drawing into surface by this amount
912
913 RECT dirty_rect; // in surface coordinates, used for GetWindowDC()/GetDC()/etc
914 bool dirty_rect_valid;
915#else
916 void *ownedData; // for mem contexts, support a null rendering
917#endif
918
922
923 int cur_text_color_int; // text color as int
924
928
929 struct HDC__ *_next;
931};
932
934bool DestroyPopupMenus(void);
937
938void SWELL_RunEvents();
939
941
942void swell_on_toplevel_raise(SWELL_OSWINDOW wnd); // called by swell-generic-gdk when a window is focused
943
950void swell_oswindow_resize(SWELL_OSWINDOW wnd, int reposflag, RECT f);
954void swell_oswindow_manage(HWND hwnd, bool wantfocus);
956HWND swell_window_wants_all_input(); // window with an active drag of menubar will have this set, to route all mouse events to nonclient area of window
957int swell_delegate_menu_message(HWND src, LPARAM lParam, int msg, bool screencoords); // menubar/menus delegate to submenus during drag.
958
960
961extern bool swell_is_likely_capslock; // only used when processing dit events for a-zA-Z
962extern const char *g_swell_appname;
963extern SWELL_OSWINDOW SWELL_focused_oswindow; // top level window which has focus (might not map to a HWND__!)
965extern HWND SWELL_topwindows; // front of list = most recently active
966
967int swell_is_app_inactive(); // returns >0 if definitely inactive, -1 if maybe
968
969#ifdef _DEBUG
970void VALIDATE_HWND_LIST(HWND list, HWND par);
971#else
972#define VALIDATE_HWND_LIST(list, par) do { } while (0)
973#endif
974
975
976#endif // !OSX
977
979
980// GDP internals
981#define TYPE_PEN 1
982#define TYPE_BRUSH 2
983#define TYPE_FONT 3
984#define TYPE_BITMAP 4
985
986typedef struct
987{
988 void *instptr;
989#ifdef __APPLE__
990 void *bundleinstptr;
991#endif
993
994#ifndef SWELL_EXTRA_MINIMAL
995 int (*SWELL_dllMain)(HINSTANCE, DWORD,LPVOID); //last parm=SWELLAPI_GetFunc
997#endif
1000
1001
1002enum
1003{
1008 INTERNAL_OBJECT_EXTERNALSOCKET, // socket not owned by us
1013};
1014
1015typedef struct
1016{
1017 int type; // INTERNAL_OBJECT_*
1018 int count; // reference count
1020
1030
1031typedef struct
1032{
1034
1035 pthread_mutex_t mutex;
1036 pthread_cond_t cond;
1037
1040
1042
1043
1044// used for both INTERNAL_OBJECT_EXTERNALSOCKET and INTERNAL_OBJECT_SOCKETEVENT.
1045// if EXTERNALSOCKET, socket[1] ignored and autoReset ignored.
1052
1059
1065
1072
1074
1075#ifdef SWELL_INTERNAL_HTREEITEM_IMPL
1076
1078{
1079 m_param=0;
1080 m_value=0;
1081 m_haschildren=false;
1082#ifdef SWELL_TARGET_OSX
1083 m_dh = [[SWELL_DataHold alloc] initWithVal:this];
1084#else
1085 m_state=0;
1086#endif
1087}
1089{
1090 free(m_value);
1091 m_children.Empty(true);
1092#ifdef SWELL_TARGET_OSX
1093 if (m_dh)
1094 {
1095 m_dh->m_data = NULL;
1096 [m_dh release];
1097 }
1098#endif
1099}
1100
1101
1102bool HTREEITEM__::FindItem(HTREEITEM it, HTREEITEM__ **parOut, int *idxOut)
1103{
1104 int a=m_children.Find((HTREEITEM__*)it);
1105 if (a>=0)
1106 {
1107 if (parOut) *parOut=this;
1108 if (idxOut) *idxOut=a;
1109 return true;
1110 }
1111 int x;
1112 const int n=m_children.GetSize();
1113 for (x = 0; x < n; x ++)
1114 {
1115 if (m_children.Get(x)->FindItem(it,parOut,idxOut)) return true;
1116 }
1117 return false;
1118}
1119
1120#endif
1121
1122#ifdef SWELL_INTERNAL_MERGESORT_IMPL
1123
1124static int __listview_sortfunc(void *p1, void *p2, int (*compar)(LPARAM val1, LPARAM val2, LPARAM userval), LPARAM userval)
1125{
1128 return compar(a->m_param,b->m_param,userval);
1129}
1130
1131
1132static void __listview_mergesort_internal(void *base, size_t nmemb, size_t size,
1133 int (*compar)(LPARAM val1, LPARAM val2, LPARAM userval),
1134 LPARAM parm,
1135 char *tmpspace)
1136{
1137 char *b1,*b2;
1138 size_t n1, n2;
1139
1140 if (nmemb < 2) return;
1141
1142 n1 = nmemb / 2;
1143 b1 = (char *) base;
1144 n2 = nmemb - n1;
1145 b2 = b1 + (n1 * size);
1146
1147 if (nmemb>2)
1148 {
1149 __listview_mergesort_internal(b1, n1, size, compar, parm, tmpspace);
1150 __listview_mergesort_internal(b2, n2, size, compar, parm, tmpspace);
1151 }
1152
1153 char *p = tmpspace;
1154
1155 do
1156 {
1157 if (__listview_sortfunc(b1, b2, compar,parm) > 0)
1158 {
1159 memcpy(p, b2, size);
1160 b2 += size;
1161 n2--;
1162 }
1163 else
1164 {
1165 memcpy(p, b1, size);
1166 b1 += size;
1167 n1--;
1168 }
1169 p += size;
1170 }
1171 while (n1 > 0 && n2 > 0);
1172
1173 if (n1 > 0) memcpy(p, b1, n1 * size);
1174 memcpy(base, tmpspace, (nmemb - n2) * size);
1175}
1176
1177
1178#endif
1179
1180#ifndef SWELL_TARGET_OSX
1181
1182#define SWELL_GENERIC_THEMESIZEDEFS(f,fd) \
1183 f(default_font_size, 12) \
1184 f(menubar_height, 17) \
1185 f(menubar_font_size, 13) \
1186 f(menubar_spacing_width, 8) \
1187 f(menubar_margin_width, 6) \
1188 f(scrollbar_width, 14) \
1189 f(smscrollbar_width, 16) \
1190 f(scrollbar_min_thumb_height, 4) \
1191 f(combo_height, 20) \
1192
1193
1194#define SWELL_GENERIC_THEMEDEFS(f,fd) \
1195 SWELL_GENERIC_THEMESIZEDEFS(f,fd) \
1196 f(_3dface,RGB(192,192,192)) \
1197 f(_3dshadow,RGB(96,96,96)) \
1198 f(_3dhilight,RGB(224,224,224)) \
1199 f(_3ddkshadow,RGB(48,48,48)) \
1200 fd(button_bg,RGB(192,192,192),_3dface) \
1201 f(button_text,RGB(0,0,0)) \
1202 f(button_text_disabled, RGB(128,128,128)) \
1203 fd(button_shadow, RGB(96,96,96), _3dshadow) \
1204 fd(button_hilight, RGB(224,224,224), _3dhilight) \
1205 f(checkbox_text,RGB(0,0,0)) \
1206 f(checkbox_text_disabled, RGB(128,128,128)) \
1207 f(checkbox_fg, RGB(0,0,0)) \
1208 f(checkbox_inter, RGB(192,192,192)) \
1209 f(checkbox_bg, RGB(255,255,255)) \
1210 f(scrollbar,RGB(32,32,32)) \
1211 f(scrollbar_fg, RGB(160,160,160)) \
1212 f(scrollbar_bg, RGB(224,224,224)) \
1213 f(edit_cursor,RGB(0,128,255)) \
1214 f(edit_bg,RGB(255,255,255)) \
1215 f(edit_bg_disabled,RGB(224,224,224)) \
1216 f(edit_text,RGB(0,0,0)) \
1217 f(edit_text_disabled, RGB(128,128,128)) \
1218 f(edit_bg_sel,RGB(128,192,255)) \
1219 f(edit_text_sel,RGB(255,255,255)) \
1220 fd(edit_hilight, RGB(224,224,224), _3dhilight) \
1221 fd(edit_shadow, RGB(96,96,96), _3dshadow) \
1222 f(info_bk,RGB(255,240,200)) \
1223 f(info_text,RGB(0,0,0)) \
1224 fd(menu_bg, RGB(192,192,192), _3dface) \
1225 fd(menu_shadow, RGB(96,96,96), _3dshadow) \
1226 fd(menu_hilight, RGB(224,224,224), _3dhilight) \
1227 fd(menu_text, RGB(0,0,0), button_text) \
1228 fd(menu_text_disabled, RGB(224,224,224), _3dhilight) \
1229 fd(menu_bg_sel, RGB(0,0,0), menu_text) \
1230 fd(menu_text_sel, RGB(224,224,224), menu_bg) \
1231 f(menu_scroll, RGB(64,64,64)) \
1232 fd(menu_scroll_arrow, RGB(96,96,96), _3dshadow) \
1233 fd(menu_submenu_arrow, RGB(96,96,96), menu_text) \
1234 fd(menu_submenu_arrow_sel, RGB(96,96,96), menu_bg) \
1235 fd(menubar_bg, RGB(192,192,192), menu_bg) \
1236 fd(menubar_bg_inactive, RGB(192,192,192), menubar_bg) \
1237 fd(menubar_text, RGB(0,0,0), menu_text) \
1238 fd(menubar_text_inactive, RGB(0,0,0), menubar_text) \
1239 fd(menubar_text_disabled, RGB(224,224,224), menu_text_disabled) \
1240 fd(menubar_bg_sel, RGB(0,0,0), menu_bg_sel) \
1241 fd(menubar_text_sel, RGB(224,224,224), menu_text_sel) \
1242 f(trackbar_track, RGB(224,224,224)) \
1243 f(trackbar_mark, RGB(96,96,96)) \
1244 f(trackbar_knob, RGB(48,48,48)) \
1245 f(progress,RGB(0,128,255)) \
1246 fd(label_text, RGB(0,0,0), button_text) \
1247 fd(label_text_disabled, RGB(128,128,128), button_text_disabled) \
1248 fd(combo_text, RGB(0,0,0), button_text) \
1249 fd(combo_text_disabled, RGB(128,128,128), button_text_disabled) \
1250 fd(combo_bg, RGB(192,192,192), _3dface) \
1251 f(combo_bg2, RGB(255,255,255)) \
1252 fd(combo_shadow, RGB(96,96,96), _3dshadow) \
1253 fd(combo_hilight, RGB(224,224,224), _3dhilight) \
1254 fd(combo_arrow, RGB(96,96,96), _3dshadow) \
1255 fd(combo_arrow_press, RGB(224,224,224), _3dhilight) \
1256 f(listview_bg, RGB(255,255,255)) \
1257 f(listview_bg_sel, RGB(128,128, 255)) \
1258 f(listview_text, RGB(0,0,0)) \
1259 fd(listview_text_sel, RGB(255,255,255), listview_text) \
1260 fd(listview_bg_sel_inactive, RGB(200,200,200), listview_bg_sel) \
1261 fd(listview_text_sel_inactive, RGB(0,0,0), listview_text_sel) \
1262 fd(listview_grid, RGB(224,224,224), _3dhilight) \
1263 f(listview_hdr_arrow,RGB(96,96,96)) \
1264 fd(listview_shadow, RGB(96,96,96), _3dshadow) \
1265 fd(listview_hilight, RGB(224,224,224), _3dhilight) \
1266 fd(listview_hdr_shadow, RGB(96,96,96), _3dshadow) \
1267 fd(listview_hdr_hilight, RGB(224,224,224), _3dhilight) \
1268 fd(listview_hdr_bg, RGB(192,192,192), _3dface) \
1269 fd(listview_hdr_text, RGB(0,0,0), button_text) \
1270 f(treeview_text,RGB( 0,0,0)) \
1271 f(treeview_bg, RGB(255,255,255)) \
1272 f(treeview_bg_sel, RGB(128,128,255)) \
1273 f(treeview_text_sel, RGB(255,255,255)) \
1274 fd(treeview_bg_sel_inactive, RGB(200,200,200), treeview_bg_sel) \
1275 fd(treeview_text_sel_inactive, RGB(0,0,0), treeview_text_sel) \
1276 f(treeview_arrow, RGB(96,96,96)) \
1277 fd(treeview_shadow, RGB(96,96,96), _3dshadow) \
1278 fd(treeview_hilight, RGB(224,224,224), _3dhilight) \
1279 fd(tab_shadow, RGB(96,96,96), _3dshadow) \
1280 fd(tab_hilight, RGB(224,224,224), _3dhilight) \
1281 fd(tab_text, RGB(0,0,0), button_text) \
1282 f(focusrect,RGB(255,0,0)) \
1283 f(group_text,RGB(0,0,0)) \
1284 fd(group_shadow, RGB(96,96,96), _3dshadow) \
1285 fd(group_hilight, RGB(224,224,224), _3dhilight) \
1286 f(focus_hilight, RGB(140,190,233)) \
1287
1288
1289
1291#define __def_theme_ent(x,c) int x;
1292#define __def_theme_ent_fb(x,c,fb) int x;
1294#undef __def_theme_ent
1295#undef __def_theme_ent_fb
1296};
1297
1298#define SWELL_UI_SCALE(x) (((x)*g_swell_ui_scale)/256)
1299void swell_scaling_init(bool no_auto_hidpi);
1300extern int g_swell_ui_scale;
1302extern const char *g_swell_deffont_face;
1304
1305#endif
1306
1307
1308static WDL_STATICFUNC_UNUSED int ext_valid_for_extlist(const char *thisext, const char *extlist)
1309{
1310 if (!thisext || *thisext != '.' || !extlist) return -1;
1311 int txlen = (int)strlen(thisext), witem = 0;
1312 while (*extlist)
1313 {
1314 while (*extlist) extlist++; // description
1315 extlist++;
1316
1317 while (*extlist)
1318 {
1319 while (*extlist == ' ' || *extlist == ';') extlist++;
1320 if (*extlist == '*')
1321 {
1322 if (!strnicmp(extlist+1,thisext,txlen) &&
1323 (extlist[1+txlen] == ';' ||extlist[1+txlen] == 0))
1324 return witem;
1325 }
1326 while (*extlist && *extlist != ';') extlist++;
1327 if (*extlist) extlist++;
1328 }
1329
1330 while (*extlist) extlist++;
1331 extlist++;
1332 witem++;
1333 }
1334 return -1;
1335}
1336
1337#endif
#define NULL
Definition CarlaBridgeFormat.cpp:30
uint8_t a
Definition Spc_Cpu.h:141
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
Definition lice.h:84
Definition swell-internal.h:27
LPARAM m_param
Definition swell-internal.h:33
~SWELL_ListView_Row()
Definition swell-internal.h:30
int m_imageidx
Definition swell-internal.h:34
int m_tmp
Definition swell-internal.h:35
SWELL_ListView_Row()
Definition swell-internal.h:29
WDL_PtrList< char > m_vals
Definition swell-internal.h:31
Definition ptrlist.h:40
Definition assocarray.h:376
UINT_D64 w
Definition inflate.c:942
int y
Definition inflate.c:1588
unsigned v[N_MAX]
Definition inflate.c:1584
unsigned x[BMAX+1]
Definition inflate.c:1586
unsigned f
Definition inflate.c:1572
static const char * name
Definition pugl.h:1582
JSAMPIMAGE data
Definition jpeglib.h:945
static const SerdStyle style
Definition sratom.c:36
const char * msg
Definition missing_descriptor.c:20
Definition swell-internal.h:908
int cur_text_color_int
Definition swell-internal.h:923
struct HDC__ * _next
Definition swell-internal.h:929
float lastpos_x
Definition swell-internal.h:927
void * ownedData
Definition swell-internal.h:916
HGDIOBJ__ * curfont
Definition swell-internal.h:921
int curbkcol
Definition swell-internal.h:925
float lastpos_y
Definition swell-internal.h:927
bool _infreelist
Definition swell-internal.h:930
HGDIOBJ__ * curpen
Definition swell-internal.h:919
int curbkmode
Definition swell-internal.h:926
HGDIOBJ__ * curbrush
Definition swell-internal.h:920
Definition swell-internal.h:893
float alpha
Definition swell-internal.h:900
int color
Definition swell-internal.h:897
struct HGDIOBJ__ * _next
Definition swell-internal.h:902
int wid
Definition swell-internal.h:898
void * typedata
Definition swell-internal.h:904
bool _infreelist
Definition swell-internal.h:903
int type
Definition swell-internal.h:894
int additional_refcnt
Definition swell-internal.h:895
WDL_PtrList< MENUITEMINFO > items
Definition swell-internal.h:880
HMENU__()
Definition swell-internal.h:875
~HMENU__()
Definition swell-internal.h:888
void Release()
Definition swell-internal.h:878
int m_refcnt
Definition swell-internal.h:882
void Retain()
Definition swell-internal.h:877
int sel_vis
Definition swell-internal.h:881
HMENU__ * Duplicate()
Definition swell-menu-generic.cpp:40
static void freeMenuItem(void *p)
Definition swell-menu-generic.cpp:58
Definition swell-internal.h:782
WDL_PtrList< HTREEITEM__ > m_children
Definition swell-internal.h:795
bool FindItem(HTREEITEM it, HTREEITEM__ **parOut, int *idxOut)
LPARAM m_param
Definition swell-internal.h:796
bool m_haschildren
Definition swell-internal.h:793
char * m_value
Definition swell-internal.h:794
int m_state
Definition swell-internal.h:790
SWELL_OSWINDOW m_oswindow
Definition swell-internal.h:830
int m_style
Definition swell-internal.h:839
void Release()
Definition swell-internal.h:826
bool m_israised
Definition swell-internal.h:851
void Retain()
Definition swell-internal.h:825
DLGPROC m_dlgproc
Definition swell-internal.h:842
int m_oswindow_private
Definition swell-internal.h:856
UINT m_id
Definition swell-internal.h:838
int m_exstyle
Definition swell-internal.h:839
bool m_wantfocus
Definition swell-internal.h:849
~HWND__()
Definition swell-wnd-generic.cpp:136
HWND__(HWND par, int wID=0, const RECT *wndr=NULL, const char *label=NULL, bool visible=false, WNDPROC wndproc=NULL, DLGPROC dlgproc=NULL, HWND ownerWindow=NULL)
Definition swell-wnd-generic.cpp:87
HWND__ * m_children
Definition swell-internal.h:834
int m_refcnt
Definition swell-internal.h:855
HWND__ * m_focused_child
Definition swell-internal.h:836
HWND__ * m_next
Definition swell-internal.h:834
int m_oswindow_fullscreen
Definition swell-internal.h:853
HWND__ * m_owned_next
Definition swell-internal.h:835
INT_PTR m_userdata
Definition swell-internal.h:840
bool m_visible
Definition swell-internal.h:846
HWND__ * m_parent
Definition swell-internal.h:834
RECT m_position
Definition swell-internal.h:837
bool m_enabled
Definition swell-internal.h:848
HMENU m_menu
Definition swell-internal.h:858
WDL_StringKeyedArray< void * > m_props
Definition swell-internal.h:861
INT_PTR m_extra[64]
Definition swell-internal.h:843
bool m_has_had_position
Definition swell-internal.h:852
char m_hashaddestroy
Definition swell-internal.h:847
const char * m_classname
Definition swell-internal.h:828
HWND__ * m_owned_prev
Definition swell-internal.h:835
HWND__ * m_owned_list
Definition swell-internal.h:835
INT_PTR m_private_data
Definition swell-internal.h:844
WDL_FastString m_title
Definition swell-internal.h:832
HWND__ * m_prev
Definition swell-internal.h:834
HWND__ * m_owner
Definition swell-internal.h:835
HFONT m_font
Definition swell-internal.h:859
WNDPROC m_wndproc
Definition swell-internal.h:841
Definition swell-types.h:535
Definition swell-types.h:218
Definition swell-types.h:231
Definition swell-dlggen.h:193
Definition swell-internal.h:987
void * instptr
Definition swell-internal.h:988
void * lastSymbolRequested
Definition swell-internal.h:998
int refcnt
Definition swell-internal.h:992
BOOL(* dllMain)(HINSTANCE, DWORD, LPVOID)
Definition swell-internal.h:996
int(* SWELL_dllMain)(HINSTANCE, DWORD, LPVOID)
Definition swell-internal.h:995
Definition swell-internal.h:1032
pthread_mutex_t mutex
Definition swell-internal.h:1035
bool isManualReset
Definition swell-internal.h:1039
bool isSignal
Definition swell-internal.h:1038
SWELL_InternalObjectHeader hdr
Definition swell-internal.h:1033
pthread_cond_t cond
Definition swell-internal.h:1036
Definition swell-internal.h:1054
SWELL_InternalObjectHeader hdr
Definition swell-internal.h:1055
FILE * fp
Definition swell-internal.h:1057
Definition swell-internal.h:1061
SWELL_InternalObjectHeader hdr
Definition swell-internal.h:1062
void * task
Definition swell-internal.h:1063
Definition swell-internal.h:1067
int done
Definition swell-internal.h:1070
int pid
Definition swell-internal.h:1069
int result
Definition swell-internal.h:1070
SWELL_InternalObjectHeader hdr
Definition swell-internal.h:1068
Definition swell-internal.h:1047
bool autoReset
Definition swell-internal.h:1050
SWELL_InternalObjectHeader hdr
Definition swell-internal.h:1048
int socket[2]
Definition swell-internal.h:1049
Definition swell-internal.h:1022
pthread_t pt
Definition swell-internal.h:1026
bool done
Definition swell-internal.h:1028
DWORD(* threadProc)(LPVOID)
Definition swell-internal.h:1024
void * threadParm
Definition swell-internal.h:1025
SWELL_InternalObjectHeader hdr
Definition swell-internal.h:1023
DWORD retv
Definition swell-internal.h:1027
Definition swell-internal.h:1016
int count
Definition swell-internal.h:1018
int type
Definition swell-internal.h:1017
Definition swell-internal.h:1290
void DWORD DWORD LPVOID parm
Definition swell-functions.h:807
RECT const char void HWND hwnd
Definition swell-functions.h:1066
const char const char const char const char * extlist
Definition swell-functions.h:167
swell_colortheme g_swell_ctheme
Definition swell-gdi-generic.cpp:34
#define __def_theme_ent(x, c)
const char * g_swell_deffont_face
Definition swell-gdi-generic.cpp:31
int g_swell_ui_scale
Definition swell-gdi-generic.cpp:60
#define __def_theme_ent_fb(x, c, fb)
HWND swell_captured_window
Definition swell-wnd-generic.cpp:47
static WDL_STATICFUNC_UNUSED int ext_valid_for_extlist(const char *thisext, const char *extlist)
Definition swell-internal.h:1308
void swell_oswindow_update_enable(HWND hwnd)
Definition swell-generic-headless.cpp:107
void swell_oswindow_invalidate(HWND hwnd, const RECT *r)
Definition swell-generic-headless.cpp:149
bool swell_is_likely_capslock
Definition swell-wnd-generic.cpp:45
int swell_is_app_inactive()
Definition swell-generic-headless.cpp:313
HWND GetFocusIncludeMenus()
Definition swell-wnd-generic.cpp:561
void swell_oswindow_update_style(HWND hwnd, LONG oldstyle)
Definition swell-generic-headless.cpp:103
HWND swell_oswindow_to_hwnd(SWELL_OSWINDOW w)
Definition swell-wnd-generic.cpp:57
const char * g_swell_appname
Definition swell.cpp:1089
LRESULT SwellDialogDefaultWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:6999
void * SWELL_OSWINDOW
Definition swell-internal.h:815
bool swell_isOSwindowmenu(SWELL_OSWINDOW osw)
Definition swell-menu-generic.cpp:392
void SWELL_RunEvents()
Definition swell-generic-headless.cpp:98
bool IsRightClickEmulateEnabled()
Definition swell-misc-generic.cpp:31
HDC SWELL_CreateGfxContext(void *)
Definition swell-gdi-generic.cpp:74
void swell_oswindow_postresize(HWND hwnd, RECT f)
Definition swell-generic-headless.cpp:148
HWND swell_window_wants_all_input()
Definition swell-wnd-generic.cpp:7162
void swell_oswindow_manage(HWND hwnd, bool wantfocus)
Definition swell-generic-headless.cpp:78
int swell_delegate_menu_message(HWND src, LPARAM lParam, int msg, bool screencoords)
Definition swell-menu-generic.cpp:359
void swell_oswindow_update_text(HWND hwnd)
Definition swell-generic-headless.cpp:46
@ INTERNAL_OBJECT_START
Definition swell-internal.h:1004
@ INTERNAL_OBJECT_THREAD
Definition swell-internal.h:1005
@ INTERNAL_OBJECT_SOCKETEVENT
Definition swell-internal.h:1009
@ INTERNAL_OBJECT_PID
Definition swell-internal.h:1011
@ INTERNAL_OBJECT_NSTASK
Definition swell-internal.h:1010
@ INTERNAL_OBJECT_EXTERNALSOCKET
Definition swell-internal.h:1008
@ INTERNAL_OBJECT_END
Definition swell-internal.h:1012
@ INTERNAL_OBJECT_EVENT
Definition swell-internal.h:1006
@ INTERNAL_OBJECT_FILE
Definition swell-internal.h:1007
HWND SWELL_topwindows
Definition swell-wnd-generic.cpp:56
void swell_on_toplevel_raise(SWELL_OSWINDOW wnd)
Definition swell-wnd-generic.cpp:65
#define VALIDATE_HWND_LIST(list, par)
Definition swell-internal.h:972
void swell_oswindow_destroy(HWND hwnd)
Definition swell-generic-headless.cpp:34
SWELL_OSWINDOW SWELL_focused_oswindow
Definition swell-wnd-generic.cpp:46
void swell_scaling_init(bool no_auto_hidpi)
void swell_oswindow_focus(HWND hwnd)
Definition swell-generic-headless.cpp:52
HWND DialogBoxIsActive(void)
Definition swell-dlg-generic.cpp:72
void swell_oswindow_resize(SWELL_OSWINDOW wnd, int reposflag, RECT f)
Definition swell-generic-headless.cpp:147
#define SWELL_GENERIC_THEMEDEFS(f, fd)
Definition swell-internal.h:1194
bool DestroyPopupMenus(void)
Definition swell-menu-generic.cpp:1193
void swell_oswindow_begin_resize(SWELL_OSWINDOW wnd)
Definition swell-generic-headless.cpp:146
void swell_oswindow_updatetoscreen(HWND hwnd, RECT *rect)
Definition swell-generic-headless.cpp:74
void swell_dlg_destroyspare()
Definition swell-dlg-generic.cpp:88
HFONT SWELL_GetDefaultFont(void)
Definition swell-gdi-generic.cpp:154
HWND ChildWindowFromPoint(HWND h, POINT p)
Definition swell-wnd-generic.cpp:6761
void * HINSTANCE
Definition swell-types.h:212
uintptr_t UINT_PTR
Definition swell-types.h:43
LONG_PTR LRESULT
Definition swell-types.h:171
unsigned int UINT
Definition swell-types.h:166
LONG_PTR LPARAM
Definition swell-types.h:170
signed char BOOL
Definition swell-types.h:160
intptr_t INT_PTR
Definition swell-types.h:42
intptr_t LONG_PTR
Definition swell-types.h:42
unsigned int DWORD
Definition swell-types.h:164
#define strnicmp(x, y, z)
Definition swell-types.h:71
ULONG_PTR WPARAM
Definition swell-types.h:169
LRESULT(* WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition swell-types.h:587
struct HGDIOBJ__ * HFONT
Definition swell-types.h:272
struct HTREEITEM__ * HTREEITEM
Definition swell-types.h:418
struct HMENU__ * HMENU
Definition swell-types.h:211
void(* TIMERPROC)(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition swell-types.h:215
signed int LONG
Definition swell-types.h:182
BOOL(* PROPENUMPROCEX)(HWND hwnd, const char *lpszString, HANDLE hData, LPARAM lParam)
Definition swell-types.h:639
void * HANDLE
Definition swell-types.h:212
void * LPVOID
Definition swell-types.h:174
struct HWND__ * HWND
Definition swell-types.h:210
struct HDC__ * HDC
Definition swell-types.h:263
INT_PTR(* DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition swell-types.h:586
int n
Definition crypt.c:458
uch * p
Definition crypt.c:594
memcpy(hh, h, RAND_HEAD_LEN)
int r
Definition crypt.c:458
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
b
Definition crypt.c:628
ZCONST uch * init
Definition extract.c:2392
ulg size
Definition extract.c:2350
typedef int(UZ_EXP MsgFn)()
#define void
Definition unzip.h:396
#define WDL_STATICFUNC_UNUSED
Definition wdltypes.h:87
#define const
Definition zconf.h:137