LMMS
Loading...
Searching...
No Matches
swell-functions.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 SWELL provides _EXTREMELY BASIC_ win32 wrapping for OS X and maybe other platforms.
22
23 */
24
25#ifndef _WDL_SWELL_H_API_DEFINED_
26#define _WDL_SWELL_H_API_DEFINED_
27
31
32#ifndef SWELL_API_DEFINE
33
34
35#if defined(SWELL_PROVIDED_BY_APP) || defined(SWELL_LOAD_SWELL_DYLIB)
36 #ifdef __cplusplus
37 #define SWELL_API_DEFINE(ret,func,parms) extern "C" ret (*func)parms;
38 #else
39 #define SWELL_API_DEFINE(ret,func,parms) extern ret (*func)parms;
40 #endif
41#else
42#define SWELL_API_DEFINE(ret,func,parms) ret func parms ;
43#endif
44#endif
45
46// when adding APIs, add it using:
47// SWELL_API_DEFINE(void, function_name, (int parm, int parm2))
48// rather than:
49// void function_name(int parm, int parm2);
50
51/*
52** lstrcpyn: this is provided because strncpy is braindead (filling with zeroes, and not
53** NULL terminating if the destination buffer is too short? ASKING for trouble..)
54** lstrpcyn always null terminates the string and doesnt fill anything extra.
55**
56** note: wdlcstring.h defines lstrcpyn_safe(), which is preferred on win32 because of
57** exception handling behavior.
58*/
59SWELL_API_DEFINE(char *, lstrcpyn, (char *dest, const char *src, int l))
60
61
62/*
63** MulDiv(): (parm1*parm2)/parm3
64** Implemented using long longs.
65*/
66SWELL_API_DEFINE(int, MulDiv, (int, int, int))
67
68
69/*
70** Sleep() sleeps for specified milliseconds. This maps to usleep, with a ms value of 0
71** usleeping for 100 microseconds.
72*/
73SWELL_API_DEFINE(void, Sleep,(int ms))
74
75/*
76** GetTickCount() and timeGetTime() give you ms level timings via gettimeofday() or mach_getabsolutetime() or clock_gettime()
77**
78** NOTE: This doesn't map to time since system start (like in win32), so a wrap around
79** is slightly more likely (i.e. even if you booted your system an hour ago it could happen).
80*/
82#ifndef timeGetTime
83#define timeGetTime() GetTickCount()
84#endif
85
86/*
87** GetFileTime() gets the file time of a file (FILE *), and converts it to the Windows time.
88**
89** NOTE: while it returns a 64 bit time value, it is only accurate to the second since thats
90** what fstat() returns. Takes an int filedes rather than a HANDLE.
91*/
92SWELL_API_DEFINE(BOOL, GetFileTime,(int filedes, FILETIME *lpCreationTime, FILETIME *lpLastAccessTime, FILETIME *lpLastWriteTime))
93
94/*
95** *PrivateProfileString/Int():
96** These are mostly thread-safe, mostly inter-process safe, and mostly module safe
97** (i.e. writes from other modules) should be synchronized).
98**
99** NOTES:
100** the filename used MUST be the full filename, unlike on Windows where files without paths go to
101** C:/Windows, here they will be opened in the current directory.
102**
103** You can pass an empty string for filename to use ~/.libSwell.ini (that can be overridden by the app)
104**
105** It's probably not a good idea to push your luck with simultaneous writes from multiple
106** modules in different threads/processes, but in theory it should work.
107*/
108SWELL_API_DEFINE(BOOL, WritePrivateProfileString, (const char *appname, const char *keyname, const char *val, const char *fn))
109SWELL_API_DEFINE(DWORD, GetPrivateProfileString, (const char *appname, const char *keyname, const char *def, char *ret, int retsize, const char *fn))
110SWELL_API_DEFINE(int, GetPrivateProfileInt,(const char *appname, const char *keyname, int def, const char *fn))
111SWELL_API_DEFINE(BOOL, GetPrivateProfileStruct,(const char *appname, const char *keyname, void *buf, int bufsz, const char *fn))
112SWELL_API_DEFINE(BOOL, WritePrivateProfileStruct,(const char *appname, const char *keyname, const void *buf, int bufsz, const char *fn))
113SWELL_API_DEFINE(BOOL, WritePrivateProfileSection, (const char *appname, const char *strings, const char *fn))
114SWELL_API_DEFINE(DWORD, GetPrivateProfileSection, (const char *appname, char *strout, DWORD strout_len, const char *fn))
115
116/*
117** GetModuleFileName()
118** Can pass NULL (exe filename) or a hInstance from DllMain or LoadLibrary
119*/
121
122#ifdef SWELL_TARGET_OSX
123/*
124** SWELL_CStringToCFString(): Creates a CFString/NSString * from a C string. This is mostly
125** used internally but you may wish to use it as well (though none of the SWELL APIs take
126** CFString/NSString.
127*/
128SWELL_API_DEFINE(void *,SWELL_CStringToCFString,(const char *str))
129SWELL_API_DEFINE(void, SWELL_CFStringToCString, (const void *str, char *buf, int buflen))
130#endif
131
132
133#ifdef PtInRect
134#undef PtInRect
135// #define funkiness because some Mac system headers define PtInRect as well.
136#endif
137#define PtInRect(r,p) SWELL_PtInRect(r,p)
139
140/*
141** ShellExecute():
142** notes:
143** action is ignored
144** content1 can be a http:// or https:// URL
145** content1 can be notepad/notepad.exe (maps to xdg-open or TextEdit.app) w/ content2 as a document
146** content1 can be explorer.exe (optionally with /select) (maps to open finder or xdg-open)
147** otherwise content1 can be an app w/ parameters in content2
148*/
149SWELL_API_DEFINE(BOOL, ShellExecute,(HWND hwndDlg, const char *action, const char *content1, const char *content2, const char *content3, int blah))
150
151SWELL_API_DEFINE(int, MessageBox,(HWND hwndParent, const char *text, const char *caption, int type))
152
153
154/*
155** GetOpenFileName() / GetSaveFileName()
156** These are a different API because we didnt feel like reeimplimenting the full API.
157** Extlist is something similar you'd pass getopenfilename,
158** initialdir and initialfile are optional (and NULL means not set).
159*/
160
161// free() the result of this, if non-NULL.
162// if allowmul is set, the multiple files are specified the same way GetOpenFileName() returns.
164 const char *initialfile, bool allowmul, const char *extlist))
165
166// returns TRUE if file was chosen.
168 char *fn, int fnsize))
169
170// returns TRUE if path was chosen.
171SWELL_API_DEFINE(bool, BrowseForDirectory,(const char *text, const char *initialdir, char *fn, int fnsize))
172
173// can use this before calling BrowseForFiles or BrowseForSaveFile to use a template dialog
174SWELL_API_DEFINE(void,BrowseFile_SetTemplate,(const char *dlgid, DLGPROC dlgProc, struct SWELL_DialogResourceIndex *reshead))
175
176
177// Note that window functions are generally NOT threadsafe.
178// on macOS: all of these treat HWND as NSView and/or NSWindow (usually smartish about it)
179
180/*
181 * GetDlgItem() notes:
182** macOS: GetDlgItem(hwnd,0) returns hwnd if hwnd is a NSView, or the contentview if hwnd is a NSWindow.
183** macOS: note that this GetDlgItem will actually search a view hierarchy for the tagged view (win32 or -generic will only search immediate children)
184*/
186
187
188SWELL_API_DEFINE(void, ShowWindow,(HWND, int))
189
191
193
195
196/*
197** These should all work like their Win32 versions, though if idx=0 it gets/sets the
198** value for the window.
199**
200** macOS: SetDlgItemText() for an edit control does NOT send a WM_COMMAND notification (win32 and -generic do)
201*/
203SWELL_API_DEFINE(BOOL, SetDlgItemInt,(HWND, int idx, int val, int issigned))
204SWELL_API_DEFINE(int, GetDlgItemInt,(HWND, int idx, BOOL *translated, int issigned))
205SWELL_API_DEFINE(BOOL, GetDlgItemText,(HWND, int idx, char *text, int textlen))
207
208#ifndef GetWindowText
209#define GetWindowText(hwnd,text,textlen) GetDlgItemText(hwnd,0,text,textlen)
210#define SetWindowText(hwnd,text) SetDlgItemText(hwnd,0,text)
211#endif
212
213
214SWELL_API_DEFINE(void, CheckDlgButton,(HWND hwnd, int idx, int check))
216SWELL_API_DEFINE(void, EnableWindow,(HWND hwnd, int enable))
221#ifndef GetActiveWindow
222#define GetActiveWindow() GetForegroundWindow()
223#endif
224#ifndef SetActiveWindow
225#define SetActiveWindow(x) SetForegroundWindow(x)
226#endif
227
228/*
229** macOS: note that any HWND that returns YES to swellCapChangeNotify should do the following on
230** destroy or dealloc: if (GetCapture()==(HWND)self) ReleaseCapture(); Failure to do so
231** can cause a dealloc'd window to get messages sent to it.
232*/
236
237/*
238** IsChild()
239** macOS: hwndChild must be a NSView, hwndParent can be a NSWindow or NSView. NSWindow level ownership/children are not detected.
240*/
241SWELL_API_DEFINE(int, IsChild,(HWND hwndParent, HWND hwndChild))
242
243
245
246/*
247** SetParent()
248** macOS: hwnd must be a NSView, newPar can be either NSView or NSWindow.
249*/
251
253
255
256SWELL_API_DEFINE(HWND,FindWindowEx,(HWND par, HWND lastw, const char *classname, const char *title))
257
258
259/*
260** macOS note: common win32 code like this:
261** RECT r;
262** GetWindowRect(hwnd,&r);
263** ScreenToClient(otherhwnd,(LPPOINT)&r);
264** ScreenToClient(otherhwnd,((LPPOINT)&r)+1);
265** does work, however be aware that in certain instances r.bottom may be less
266** than r.top, due to flipped coordinates. SetWindowPos and other functions
267** handle negative heights gracefully, and you should too.
268**
269** GetWindowContentViewRect gets the rectangle of the content view (pre-NCCALCSIZE etc)
270*/
277SWELL_API_DEFINE(BOOL, WinOffsetRect, (LPRECT lprc, int dx, int dy))
278SWELL_API_DEFINE(BOOL, WinSetRect, (LPRECT lprc, int xLeft, int yTop, int xRight, int yBottom))
281
282SWELL_API_DEFINE(void, SetWindowPos,(HWND hwnd, HWND unused, int x, int y, int cx, int cy, int flags))
283
284SWELL_API_DEFINE(int, SWELL_SetWindowLevel, (HWND hwnd, int newlevel))
285
287
289
290
291/*
292** GetWindowLong()/SetWindowLong()
293**
294** macOS:
295** GWL_ID is supported for all objects that support the 'tag'/'setTag' methods,
296** which would be controls and SWELL created windows/dialogs/controls.
297**
298** GWL_USERDATA is supported by SWELL created windows/dialogs/controls, using
299** (int)getSwellUserData and setSwellUserData:(int).
300**
301** GWL_WNDPROC is supported by SWELL created windows/dialogs/controls, using
302** (int)getSwellWindowProc and setSwellWindowProc:(int).
303**
304** DWL_DLGPROC is supported by SWELL-created dialogs now (it might work in windows/controls but isnt recommended)
305**
306** GWL_STYLE is only supported for NSButton. Currently the only flags supported are
307** BS_AUTO3STATE (BS_AUTOCHECKBOX is returned but also ignored).
308**
309** indices of >= 0 and < 128 (32 integers) are supported for SWELL created
310** windows/dialogs/controls, via (int)getSwellExtraData:(int)idx and
311** setSwellExtraData:(int)idx value:(int)val .
312**
313** generic: indices of >= 0 && < 64*sizeof(INT_PTR) are supported
314*/
317
318
319SWELL_API_DEFINE(BOOL, ScrollWindow, (HWND hwnd, int xamt, int yamt, const RECT *lpRect, const RECT *lpClipRect))
320
321/*
322** GetProp() SetProp() RemoveProp() EnumPropsEx()
323** Free your props otherwise they will leak.
324** Restriction on what you can do in the PROPENUMPROCEX is similar to win32
325** (you can remove only the called prop, and can't add props within it).
326** if the prop name is < (void *)65536 then it is treated as a short identifier.
327*/
332
333
334/*
335** IsWindowVisible()
336** macOS:
337** if hwnd is a NSView, returns !isHiddenOrHasHiddenAncestor
338** if hwnd is a NSWindow returns isVisible
339** otherwise returns TRUE if non-null hwnd
340*/
342
343// IsWindow()
344// probably best avoided.
345// macOS: very costly (compared to win32) -- enumerates all windows, searches for hwnd
346// generic: may not be implemented
348
349
350/*
351** SetTimer/KillTimer():
352** Notes:
353** The timer API may be threadsafe though it is highly untested. It is safest to only set
354** timers from the main thread.
355**
356** Kill all timers for a window using KillTimer(hwnd,-1);
357**
358** macOS: Note also that the mechanism for sending timers is SWELL_Timer:(id).
359** You MUST kill all timers for a window before destroying it. Note that SWELL created
360** windows/dialogs/controls automatically do this, but if you use SetTimer() on a NSView *
361** or NSWindow * directly, then you should kill all timers in -dealloc.
362*/
365
366#ifdef SWELL_TARGET_OSX
367/*
368** SendMessage can/should now be used with CB_* etc.
369** macOS: Combo boxes may be implemented using a NSComboBox or NSPopUpButton depending on the style.
370*/
371SWELL_API_DEFINE(int, SWELL_CB_AddString,(HWND hwnd, int idx, const char *str))
372SWELL_API_DEFINE(void, SWELL_CB_SetCurSel,(HWND hwnd, int idx, int sel))
375SWELL_API_DEFINE(void, SWELL_CB_SetItemData,(HWND hwnd, int idx, int item, LONG_PTR data))
378SWELL_API_DEFINE(int, SWELL_CB_InsertString,(HWND hwnd, int idx, int pos, const char *str))
379SWELL_API_DEFINE(int, SWELL_CB_GetItemText,(HWND hwnd, int idx, int item, char *buf, int bufsz))
380SWELL_API_DEFINE(void, SWELL_CB_DeleteString,(HWND hwnd, int idx, int wh))
381SWELL_API_DEFINE(int, SWELL_CB_FindString,(HWND hwnd, int idx, int startAfter, const char *str, bool exact))
382
383
384/*
385** Trackbar API
386** You can/should now use SendMessage with TBM_* instead.
387*/
388SWELL_API_DEFINE(void, SWELL_TB_SetPos,(HWND hwnd, int idx, int pos))
389SWELL_API_DEFINE(void, SWELL_TB_SetRange,(HWND hwnd, int idx, int low, int hi))
391SWELL_API_DEFINE(void, SWELL_TB_SetTic,(HWND hwnd, int idx, int pos))
392
393
394#endif
395
396/*
397** ListViews -- in owner data mode only LVN_GETDISPINFO is required (LVN_ODFINDITEM is never sent)
398*/
400SWELL_API_DEFINE(void, ListView_InsertColumn,(HWND h, int pos, const LVCOLUMN *lvc))
402SWELL_API_DEFINE(void, ListView_SetColumn,(HWND h, int pos, const LVCOLUMN *lvc))
405SWELL_API_DEFINE(void, ListView_SetItemText,(HWND h, int ipos, int cpos, const char *txt))
407SWELL_API_DEFINE(int, ListView_GetNextItem,(HWND h, int istart, int flags))
415SWELL_API_DEFINE(void, ListView_SetColumnWidth,(HWND h, int colpos, int wid))
416SWELL_API_DEFINE(bool, ListView_SetItemState,(HWND h, int item, UINT state, UINT statemask))
417SWELL_API_DEFINE(void, ListView_RedrawItems,(HWND h, int startitem, int enditem))
419#ifdef ListView_SetItemCountEx
420#undef ListView_SetItemCountEx
421#endif
422#define ListView_SetItemCountEx(list,cnt,flags) ListView_SetItemCount(list,cnt)
423
425SWELL_API_DEFINE(void, ListView_SetImageList,(HWND h, HIMAGELIST imagelist, int which))
427SWELL_API_DEFINE(void, ListView_GetItemText,(HWND hwnd, int item, int subitem, char *text, int textmax))
429SWELL_API_DEFINE(bool, ListView_Scroll,(HWND h, int xscroll, int yscroll))
438
439 // NOTE: the Cocoa versions of these functions behave differently than swell-generic and Windows:
440 // they return the absolute (unscrolled) coordinates. In order to behave properly, the caller should
441 // use ClientToScreen in order to get to screen coordinates, and then convert those as desired.
442SWELL_API_DEFINE(bool, ListView_GetItemRect,(HWND h, int item, RECT *r, int code))
443SWELL_API_DEFINE(bool, ListView_GetSubItemRect,(HWND h, int item, int subitem, int code, RECT *r))
444 // NOTE: Cocoa version takes absolute (unscrolled) coordinates. ScreenToClient(listview) will convert screen
445 // coordinates to the correct coorindates
447
449
450#ifndef ImageList_Create
451#define ImageList_Create(x,y,a,b,c) ImageList_CreateEx();
452#endif
455SWELL_API_DEFINE(int, ImageList_ReplaceIcon,(HIMAGELIST list, int offset, HICON image))
458/*
459** TabCtrl api.
460*/
463SWELL_API_DEFINE(int, TabCtrl_InsertItem,(HWND hwnd, int idx, TCITEM *item))
467
468/*
469** TreeView
470*/
471
483
488
495SWELL_API_DEFINE(void,ListView_SetSelColors,(HWND hwnd, int *colors, int ncolors))
496
497/*
498** These are deprecated macOS-only functions for launching a modal window but still running
499** your own code. In general use DialogBox with a timer if needed instead.
500*/
502SWELL_API_DEFINE(bool, SWELL_ModalWindowRun,(void *ctx, int *ret)) // returns false and puts retval in *ret when done
503SWELL_API_DEFINE(void, SWELL_ModalWindowEnd,(void *ctx))
505
506/*
507** Menu functions
508** macOS: HMENU is a NSMenu *.
509*/
513SWELL_API_DEFINE(int, AddMenuItem,(HMENU hMenu, int pos, const char *name, int tagid))
514SWELL_API_DEFINE(HMENU, GetSubMenu,(HMENU hMenu, int pos))
516SWELL_API_DEFINE(int, GetMenuItemID,(HMENU hMenu, int pos))
517SWELL_API_DEFINE(bool, SetMenuItemModifier,(HMENU hMenu, int idx, int flag, int code, unsigned int mask))
518SWELL_API_DEFINE(bool, SetMenuItemText,(HMENU hMenu, int idx, int flag, const char *text))
519SWELL_API_DEFINE(bool, EnableMenuItem,(HMENU hMenu, int idx, int en))
520SWELL_API_DEFINE(bool, DeleteMenu,(HMENU hMenu, int idx, int flag))
521SWELL_API_DEFINE(bool, CheckMenuItem,(HMENU hMenu, int idx, int chk))
522SWELL_API_DEFINE(void, InsertMenuItem,(HMENU hMenu, int pos, BOOL byPos, MENUITEMINFO *mi))
523SWELL_API_DEFINE(void,SWELL_InsertMenu,(HMENU menu, int pos, unsigned int flag, UINT_PTR idx, const char *str))
524#ifdef InsertMenu
525#undef InsertMenu
526#endif
527#define InsertMenu SWELL_InsertMenu
528
529SWELL_API_DEFINE(BOOL, GetMenuItemInfo,(HMENU hMenu, int pos, BOOL byPos, MENUITEMINFO *mi))
530SWELL_API_DEFINE(BOOL, SetMenuItemInfo,(HMENU hMenu, int pos, BOOL byPos, MENUITEMINFO *mi))
532
533
534
535/*
536** LoadMenu()
537** Loads a menu created with SWELL_DEFINE_MENU_RESOURCE_BEGIN(), see swell-menugen.h
538** Notes: the hinst parameter is ignored, the menu must have been defined in the same
539** module (executable or shared library) as the LoadMenu call. If you wish to load a
540** menu from another module, get its SWELL_curmodule_menuresource_head and pass it to
541** SWELL_LoadMenu directly.
542*/
543#ifndef LoadMenu
544#define LoadMenu(hinst,resid) SWELL_LoadMenu(SWELL_curmodule_menuresource_head,(resid))
545#endif
547
548/*
549** TrackPopupMenu
550** Notes: the rectangle is ignored, and resvd should always be 0.
551*/
552SWELL_API_DEFINE(int, TrackPopupMenu,(HMENU hMenu, int flags, int xpos, int ypos, int resvd, HWND hwnd, const RECT *r))
553
554/*
555** SWELL_SetMenuDestination: set the action destination for all items and subitems in a menu
556** macOS only, TrackPopupMenu and SetMenu use this internally, but it may be useful.
557*/
559
560/*
561** SWELL_DuplicateMenu:
562** Copies an entire menu.
563*/
565
566/*
567** SetMenu()/GetMenu()
568** macOS: These work on SWELL created NSWindows, or objective C objects that respond to
569** swellSetMenu:(HMENU) and swellGetMenu. SWELL windows will automatically set the
570** application menu via NSApp setMainMenu: when activated.
571*/
574
575/*
576** SWELL_SetDefaultWindowMenu()/SWELL_GetDefaultWindowMenu()
577** macOS: these set an internal flag for the default window menu, which will be set
578** when switching to a window that has no menu set. Set this to your application's
579** main menu.
580**
581** generic: these set the internal state, which is currently unused
582*/
589
590
591
592/*
593** SWELL dialog box/control/window/child dialog/etc creation
594** DialogBox(), DialogBoxParam(), CreateDialog(), and CreateDialogParam()
595**
596** Notes:
597** hInstance parameters are ignored. If you wish to load a dialog resource from another
598** module (shared library/executable), you should get its SWELL_curmodule_dialogresource_head
599** via your own mechanism and pass it as the first parameter of SWELL_DialogBox or whichever API.
600**
601** If you are using CreateDialog() and creating a child window, you can use a resource ID of
602** 0, which creates an opaque child window. Instead of passing a DLGPROC, you should pass a
603** (WNDPROC) routine that retuns LRESULT (and cast it to DLGPROC).
604**
605*/
606
607#ifndef DialogBox
608#define DialogBox(hinst, resid, par, dlgproc) SWELL_DialogBox(SWELL_curmodule_dialogresource_head,(resid),par,dlgproc,0)
609#define DialogBoxParam(hinst, resid, par, dlgproc, param) SWELL_DialogBox(SWELL_curmodule_dialogresource_head,(resid),par,dlgproc,param)
610#define CreateDialog(hinst,resid,par,dlgproc) SWELL_CreateDialog(SWELL_curmodule_dialogresource_head,(resid),par,dlgproc,0)
611#define CreateDialogParam(hinst,resid,par,dlgproc,param) SWELL_CreateDialog(SWELL_curmodule_dialogresource_head,(resid),par,dlgproc,param)
612#endif
613SWELL_API_DEFINE(int, SWELL_DialogBox,(struct SWELL_DialogResourceIndex *reshead, const char *resid, HWND parent, DLGPROC dlgproc, LPARAM param))
614SWELL_API_DEFINE(HWND, SWELL_CreateDialog,(struct SWELL_DialogResourceIndex *reshead, const char *resid, HWND parent, DLGPROC dlgproc, LPARAM param))
615
616
617/*
618** SWELL_RegisterCustomControlCreator(), SWELL_UnregisterCustomControlCreator()
619** Notes:
620** Pass these a callback function that can create custom controls based on classname.
621*/
622
625
627
628SWELL_API_DEFINE(void, EndDialog,(HWND, int))
629
630
631SWELL_API_DEFINE(int,SWELL_GetDefaultButtonID,(HWND hwndDlg, bool onlyIfEnabled))
632
633
634/*
635** SendMessage()
636** Notes:
637** LIMITATION - SendMessage should only be used from the same thread that the window/view
638** was created in. Cross-thread use SHOULD BE AVOIDED. It may work, but it may blow up.
639** PostMessage (below) can be used in certain instances for asynchronous notifications.
640*/
642
643#ifndef SendDlgItemMessage
644#define SendDlgItemMessage(hwnd,idx,msg,wparam,lparam) SendMessage(GetDlgItem(hwnd,idx),msg,wparam,lparam)
645#endif
646
647/*
648** SWELL_BroadcastMessage()
649** sends a message to all top-level windows
650*/
652
653/*
654** PostMessage()
655** Notes:
656** Queues a message into the application message queue. Note that you should only ever
657** send messages to destinations that were created from the main thread. They will be
658** processed later from a timer (in the main thread).
659** When a window is destroyed any outstanding messages will be discarded for it.
660*/
662
663/*
664** SWELL_MessageQueue_Flush():
665** Notes:
666** Processes all messages in the message queue. ONLY call from the main thread.
667*/
669
670/*
671** SWELL_MessageQueue_Clear():
672** Notes:
673** Discards all messages from the message queue if h is NULL, otherwise discards all messages
674** to h.
675*/
677
678
679
680/*
681** keyboard/mouse support
682*/
683
684/*
685** SWELL_MacKeyToWindowsKey()
686** Pass a keyboard NSEvent *, and it will return a windows VK_ keycode (or ascii), and set flags,
687** including (possibly) FSHIFT, FCONTROL (apple key), FALT, and FVIRTKEY. The ctrl key is not checked,
688** as SWELL generally encourages this to be used soley for a right mouse button (as modifier).
689** flags may also include 0x1000000 for arrow keys and home/end (matching the lParam behavior of win32),
690** or for numeric keypad enter
691*/
692#ifdef SWELL_TARGET_OSX
693SWELL_API_DEFINE(int, SWELL_MacKeyToWindowsKey,(void *nsevent, int *flags))
694
695 // ex is the same as normal, except if mode=1 it does more processing of raw keys w/ modifiers
696 // and also if nsevent==NULL current event is used
697SWELL_API_DEFINE(int, SWELL_MacKeyToWindowsKeyEx,(void *nsevent, int *flags, int mode))
698#endif
699SWELL_API_DEFINE(int,SWELL_KeyToASCII,(int wParam, int lParam, int *newflags))
700
701
702/*
703** GetAsyncKeyState()
704** macOS: only supports VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_SHIFT, VK_MENU, VK_CONTROL (apple/command key), VK_LWIN (control key)
705** GDK: only supports VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_SHIFT, VK_MENU, VK_CONTROL, VK_LWIN
706*/
708
709/*
710** GetCursorPos(), GetMessagePos()
711** GetMessagePos() currently returns the same coordinates as GetCursorPos()
712*/
715
716/*
717** LoadCursor().
718** Notes: hinstance parameter ignored, supports loading some of the predefined values (e.g. IDC_SIZEALL)
719** and cursors registered into the main module
720** macOS: HCURSOR = NSCursor *
721** see also: SWELL_LoadCursorFromFile
722*/
724#ifndef LoadCursor
725#define LoadCursor(a,x) SWELL_LoadCursor(x)
726#endif
727
728/*
729** SetCursor()
730** macOS: can cast a NSCursor* to HCURSOR if desired
731*/
732#ifdef SetCursor
733#undef SetCursor
734#endif
735#define SetCursor(x) SWELL_SetCursor(x)
737
738
739#ifdef GetCursor
740#undef GetCursor
741#endif
742#define GetCursor SWELL_GetCursor
743
744#ifdef ShowCursor
745#undef ShowCursor
746#endif
747#define ShowCursor SWELL_ShowCursor
748
749#ifdef SetCursorPos
750#undef SetCursorPos
751#endif
752#define SetCursorPos SWELL_SetCursorPos
753
754#ifdef ScrollWindowEx
755#undef ScrollWindowEx
756#endif
757#define ScrollWindowEx(a,b,c,d,e,f,g,h) ScrollWindow(a,b,c,d,e)
758
759
760/*
761** SWELL_EnableRightClickEmulate()
762** macOS only
763** Globally enable or disable emulating mouse right-click using control+left-click
764*/
766
767
768/*
769** GetCursor() gets the actual system cursor,
770** SWELL_GetLastSetCursor() gets the last cursor set via SWELL (if they differ than some other window must have changed the cursor)
771*/
774
778
779/*
780** SWELL_GetViewPort
781** Gets screen information, for the screen that contains sourcerect. if wantWork is set
782** it excluses the menu bar etc.
783*/
784SWELL_API_DEFINE(void, SWELL_GetViewPort,(RECT *r, const RECT *sourcerect, bool wantWork))
785
786/*
787** Clipboard API
788** macOS: setting multiple types may not be supported
789** GDK: only CF_TEXT is shared with system, other types are stored internally
790*/
791SWELL_API_DEFINE(bool, OpenClipboard,(HWND hwndDlg))
794
799
800SWELL_API_DEFINE(HANDLE, GlobalAlloc,(int flags, int sz))
805
806
808SWELL_API_DEFINE(HANDLE,CreateEvent,(void *SA, BOOL manualReset, BOOL initialSig, const char *ignored))
809SWELL_API_DEFINE(HANDLE,CreateEventAsSocket,(void *SA, BOOL manualReset, BOOL initialSig, const char *ignored))
810
811
812#ifdef _beginthreadex
813#undef _beginthreadex
814#endif
815#define _beginthreadex(a,b,c,d,e,f) ((UINT_PTR)CreateThread(a,b,(unsigned (*)(LPVOID))(c),d,e,(DWORD*)(f)))
816
819SWELL_API_DEFINE(DWORD,WaitForAnySocketObject,(int numObjs, HANDLE *objs, DWORD msTO))
824
825#ifdef SWELL_TARGET_OSX
826SWELL_API_DEFINE(void,SWELL_EnsureMultithreadedCocoa,())
827SWELL_API_DEFINE(void *, SWELL_InitAutoRelease,())
828SWELL_API_DEFINE(void, SWELL_QuitAutoRelease,(void *p))
829SWELL_API_DEFINE(int,SWELL_TerminateProcess,(HANDLE hand))
830SWELL_API_DEFINE(HANDLE,SWELL_CreateProcessIO,(const char *exe, int nparams, const char **params, bool redirectIO))
831SWELL_API_DEFINE(int,SWELL_ReadWriteProcessIO,(HANDLE, int w/*stdin,stdout,stderr*/, char *buf, int bufsz))
832#else
834#endif
835
836SWELL_API_DEFINE(HANDLE,SWELL_CreateProcess,(const char *exe, int nparams, const char **params))
838
839
840SWELL_API_DEFINE(HINSTANCE,LoadLibraryGlobals,(const char *fileName, bool symbolsAsGlobals))
841SWELL_API_DEFINE(HINSTANCE,LoadLibrary,(const char *fileName))
842SWELL_API_DEFINE(void *,GetProcAddress,(HINSTANCE hInst, const char *procName))
844
846
847/*
848** SWELL_CreateMemContext()
849** Creates a memory context (that you can get the bits for, below)
850** hdc is ignored
851*/
853
854/*
855** SWELL_DeleteGfxContext()
856** Deletes a context created with SWELL_CreateMemContext() (or the internal SWELL_CreateGfxContext)
857*/
859
860/*
861** SWELL_GetCtxGC()
862** macOS: Returns the CGContextRef of a HDC
863** GDK: returns NULL
864*/
866
867
868/*
869** SWELL_GetCtxFrameBuffer()
870** Gets the framebuffer of a memory context. NULL if none available.
871*/
873
874
875
876/*
877** Some utility functions for pushing, setting, and popping the clip region.
878** macOS-only
879*/
881SWELL_API_DEFINE(void, SWELL_SetClipRegion,(HDC ctx, const RECT *r))
883
884
885
887SWELL_API_DEFINE(HFONT, CreateFont,(int lfHeight, int lfWidth, int lfEscapement, int lfOrientation, int lfWeight, char lfItalic,
888 char lfUnderline, char lfStrikeOut, char lfCharSet, char lfOutPrecision, char lfClipPrecision,
889 char lfQuality, char lfPitchAndFamily, const char *lfFaceName))
890
891SWELL_API_DEFINE(HPEN, CreatePen,(int attr, int wid, int col))
893SWELL_API_DEFINE(HPEN, CreatePenAlpha,(int attr, int wid, int col, float alpha))
894SWELL_API_DEFINE(HBRUSH, CreateSolidBrushAlpha,(int col, float alpha))
898#ifndef DestroyIcon
899#define DestroyIcon(x) DeleteObject(x)
900#endif
901
902#ifdef LineTo
903#undef LineTo
904#endif
905#ifdef SetPixel
906#undef SetPixel
907#endif
908#ifdef FillRect
909#undef FillRect
910#endif
911#ifdef DrawText
912#undef DrawText
913#endif
914#ifdef Polygon
915#undef Polygon
916#endif
917
918#define DrawText SWELL_DrawText
919#define FillRect SWELL_FillRect
920#define LineTo SWELL_LineTo
921#define SetPixel SWELL_SetPixel
922#define Polygon(a,b,c) SWELL_Polygon(a,b,c)
923
924SWELL_API_DEFINE(void, SWELL_FillRect,(HDC ctx, const RECT *r, HBRUSH br))
925SWELL_API_DEFINE(void, Rectangle,(HDC ctx, int l, int t, int r, int b))
926SWELL_API_DEFINE(void, Ellipse,(HDC ctx, int l, int t, int r, int b))
927SWELL_API_DEFINE(void, SWELL_Polygon,(HDC ctx, POINT *pts, int npts))
928SWELL_API_DEFINE(void, MoveToEx,(HDC ctx, int x, int y, POINT *op))
929SWELL_API_DEFINE(void, LineTo,(HDC ctx, int x, int y))
930SWELL_API_DEFINE(void, SetPixel,(HDC ctx, int x, int y, int c))
931SWELL_API_DEFINE(void, PolyBezierTo,(HDC ctx, POINT *pts, int np))
932SWELL_API_DEFINE(int, SWELL_DrawText,(HDC ctx, const char *buf, int len, RECT *r, int align))
933SWELL_API_DEFINE(void, SetTextColor,(HDC ctx, int col))
935SWELL_API_DEFINE(void, SetBkColor,(HDC ctx, int col))
936SWELL_API_DEFINE(void, SetBkMode,(HDC ctx, int col))
937SWELL_API_DEFINE(int, GetGlyphIndicesW, (HDC ctx, wchar_t *buf, int len, unsigned short *indices, int flags))
938
939SWELL_API_DEFINE(void, RoundRect,(HDC ctx, int x, int y, int x2, int y2, int xrnd, int yrnd))
940SWELL_API_DEFINE(void, PolyPolyline,(HDC ctx, POINT *pts, DWORD *cnts, int nseg))
942SWELL_API_DEFINE(int, GetTextFace,(HDC ctx, int nCount, LPTSTR lpFaceName))
943#ifdef SWELL_TARGET_OSX
944SWELL_API_DEFINE(void *, GetNSImageFromHICON,(HICON))
945#endif
946SWELL_API_DEFINE(BOOL, GetObject, (HICON icon, int bmsz, void *_bm))
948SWELL_API_DEFINE(HICON, LoadNamedImage,(const char *name, bool alphaFromMask))
949SWELL_API_DEFINE(void, DrawImageInRect,(HDC ctx, HICON img, const RECT *r))
950SWELL_API_DEFINE(void, BitBlt,(HDC hdcOut, int x, int y, int w, int h, HDC hdcIn, int xin, int yin, int mode))
951SWELL_API_DEFINE(void, StretchBlt,(HDC hdcOut, int x, int y, int w, int h, HDC hdcIn, int xin, int yin, int srcw, int srch, int mode))
952#ifndef SWELL_TARGET_OSX
953SWELL_API_DEFINE(void, StretchBltFromMem,(HDC hdcOut, int x, int y, int w, int h, const void *bits, int srcw, int srch, int srcspan))
955#endif
956
957SWELL_API_DEFINE(void*, SWELL_ExtendedAPI, (const char *key, void *v))
958
959SWELL_API_DEFINE(int, GetSysColor,(int idx))
960SWELL_API_DEFINE(HBITMAP, CreateBitmap,(int width, int height, int numplanes, int bitsperpixel, unsigned char* bits))
961
962SWELL_API_DEFINE(void, SetOpaque, (HWND h, bool isopaque))
963SWELL_API_DEFINE(void, SetAllowNoMiddleManRendering, (HWND h, bool allow)) // defaults to allow, use this to disable
964#ifdef SWELL_TARGET_OSX
965SWELL_API_DEFINE(int, SWELL_IsRetinaDC, (HDC hdc)) // returns 1 if DC is a retina DC (2x res possible)
966SWELL_API_DEFINE(int, SWELL_IsRetinaHWND, (HWND h)) // returns 1 if HWND is a retina HWND
967#endif
968
969SWELL_API_DEFINE(void, SWELL_SetViewGL, (HWND h, char wantGL)) // wantGL=2 to enable wantsBestResolutionOpenGLSurface
971SWELL_API_DEFINE(bool, SWELL_SetGLContextToView, (HWND h)) // sets GL context to that view, returns TRUE if successs (use NULL to clear GL context)
972
973#if defined(SWELL_TARGET_OSX)
974SWELL_API_DEFINE(int, SWELL_EnableMetal,(HWND h, int mode)) // can only call once per window. calling with 0 does nothing. 1=metal enabled, 2=metal enabled and support GetDC()/ReleaseDC() for drawing (more overhead). returns metal setting. mode=-1 for non-metal async layered mode. mode=-2 for non-metal non-async layered mode
975 // NOTE: if using SWELL_EnableMetal(-1), any BitBlt()/StretchBlt() __MUST__ have the source bitmap persist. If it is resized after Blit it could cause crashes, too. So really this method is unsafe for practical use.
976#else
977 #ifndef SWELL_EnableMetal
978 #define SWELL_EnableMetal(hwnd,x) (void)(x)
979 #endif
980#endif
981
984
985SWELL_API_DEFINE(HDC, GetDC,(HWND)) // use these sparingly! they kinda work but shouldnt be overused!!
988
989#ifdef SWELL_TARGET_OSX
990SWELL_API_DEFINE(void, SWELL_FlushWindow,(HWND))
991#endif
992
993SWELL_API_DEFINE(void, SWELL_FillDialogBackground,(HDC hdc, const RECT *r, int level))
994
996
998
1002
1003// source drag/drop - callback is source implementing "create dropped files at droppath"
1005SWELL_API_DEFINE(void,SWELL_InitiateDragDropOfFileList,(HWND, RECT *srcrect, const char **srclist, int srccount, HICON icon))
1006SWELL_API_DEFINE(void, SWELL_FinishDragDrop, ()) // cancels any outstanding InitiateDragDrop
1007
1008
1009
1010// focus rects aren't implemented as XOR as on win32, might be a straight blit or a separate window
1011// rct=NULL to "free" handle
1012// otherwise rct is in hwndPar coordinates
1013SWELL_API_DEFINE(void,SWELL_DrawFocusRect,(HWND hwndPar, RECT *rct, void **handle))
1014
1015
1016#ifdef SWELL_TARGET_OSX
1017SWELL_API_DEFINE(void,SWELL_SetWindowRepre,(HWND hwnd, const char *fn, bool isDirty)) // sets the represented file and edited state
1018SWELL_API_DEFINE(void,SWELL_PostQuitMessage,(void *sender))
1019SWELL_API_DEFINE(bool,SWELL_osx_is_dark_mode,(int mode)) // mode=0 for dark mode enabled enabled, 1=dark mode allowed (Breaks various things)
1020#endif
1021
1022/*
1023** Functions used by swell-dlggen.h and swell-menugen.h
1024** No need to really dig into these unless you're working on swell or debugging..
1025*/
1026
1027SWELL_API_DEFINE(void, SWELL_MakeSetCurParms,(float xscale, float yscale, float xtrans, float ytrans, HWND parent, bool doauto, bool dosizetofit))
1028
1029SWELL_API_DEFINE(HWND, SWELL_MakeButton,(int def, const char *label, int idx, int x, int y, int w, int h, int flags))
1030SWELL_API_DEFINE(HWND, SWELL_MakeEditField,(int idx, int x, int y, int w, int h, int flags))
1031SWELL_API_DEFINE(HWND, SWELL_MakeLabel,(int align, const char *label, int idx, int x, int y, int w, int h, int flags))
1032SWELL_API_DEFINE(HWND, SWELL_MakeControl,(const char *cname, int idx, const char *classname, int style, int x, int y, int w, int h, int exstyle))
1033SWELL_API_DEFINE(HWND, SWELL_MakeCombo,(int idx, int x, int y, int w, int h, int flags))
1034SWELL_API_DEFINE(HWND, SWELL_MakeGroupBox,(const char *name, int idx, int x, int y, int w, int h, int style))
1035SWELL_API_DEFINE(HWND, SWELL_MakeCheckBox,(const char *name, int idx, int x, int y, int w, int h, int flags))
1036SWELL_API_DEFINE(HWND, SWELL_MakeListBox,(int idx, int x, int y, int w, int h, int styles))
1037
1038SWELL_API_DEFINE(void, SWELL_Menu_AddMenuItem,(HMENU hMenu, const char *name, int idx, unsigned int flags))
1039SWELL_API_DEFINE(int, SWELL_GenerateMenuFromList,(HMENU hMenu, const void *list, int listsz)) // list is SWELL_MenuGen_Entry
1040
1041SWELL_API_DEFINE(void, SWELL_GenerateDialogFromList, (const void *list, int listsz))
1042
1043
1044SWELL_API_DEFINE(unsigned int, _controlfp,(unsigned int flag, unsigned int mask))
1045
1047
1048
1052
1054
1055
1056SWELL_API_DEFINE(void,GetTempPath,(int sz, char *buf))
1057
1058#ifndef SWELL_TARGET_OSX
1059SWELL_API_DEFINE(void,SWELL_initargs,(int *argc, char ***argv))
1062#endif
1063
1065
1067
1068
1073
1074SWELL_API_DEFINE(int,AddFontResourceEx,(LPCTSTR str, DWORD fl, void *pdv))
1075
1076#ifdef SWELL_TARGET_OSX
1077SWELL_API_DEFINE(void,SWELL_DisableAppNap,(int disable))
1078SWELL_API_DEFINE(int,SWELL_GetOSXVersion,())
1079#endif
1080
1081SWELL_API_DEFINE(void,SWELL_Register_Cursor_Resource,(const char *idx, const char *name, int hotspot_x, int hotspot_y))
1082
1083SWELL_API_DEFINE(bool, SWELL_ChooseColor, (HWND, COLORREF *, int ncustom, COLORREF *custom))
1085
1087
1088SWELL_API_DEFINE(int, GetClassName, (HWND, char *, int)) // only partially implemented, if using custom control creators they should call SWELL_SetClassName() to set the class name (reading class name is desired)
1089SWELL_API_DEFINE(void, SWELL_SetClassName, (HWND, const char*)) // must pass a static string!
1090
1092
1095
1096#endif // _WDL_SWELL_H_API_DEFINED_
uint8_t a
Definition Spc_Cpu.h:141
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static const unsigned long mask[]
Definition bitwise.c:31
#define check(expr)
Definition blargg_source.h:32
UINT_D64 w
Definition inflate.c:942
int * l
Definition inflate.c:1579
struct huft * t
Definition inflate.c:943
int y
Definition inflate.c:1588
unsigned v[N_MAX]
Definition inflate.c:1584
int g
Definition inflate.c:1573
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
char * argv[]
Definition unzip.c:738
static const char * title
Definition pugl.h:1747
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
static uintptr_t parent
Definition pugl.h:1644
int val
Definition jpeglib.h:956
JSAMPIMAGE data
Definition jpeglib.h:945
#define X(str)
Definition juce_LV2Common.h:197
static const SerdStyle style
Definition sratom.c:36
float out
Definition lilv_test.c:1461
const char * msg
Definition missing_descriptor.c:20
png_structrp int mode
Definition png.h:1139
Definition swell-types.h:242
Definition swell-types.h:339
Definition swell-types.h:519
Definition swell-types.h:294
Definition swell-types.h:312
Definition swell-types.h:300
Definition swell-types.h:501
Definition swell-types.h:535
Definition swell-types.h:218
Definition swell-types.h:231
Definition swell-dlggen.h:193
Definition swell-menugen.h:46
Definition swell-types.h:355
Definition swell-types.h:526
Definition swell-types.h:485
Definition inftrees.h:27
Definition misc.c:36
#define SWELL_API_DEFINE(ret, func, parms)
Definition swell-appstub-generic.cpp:31
#define LineTo
#define SetPixel
void EndDialog(HWND wnd, int ret)
Definition swell-dlg-generic.cpp:111
int SWELL_DialogBox(SWELL_DialogResourceIndex *reshead, const char *resid, HWND parent, DLGPROC dlgproc, LPARAM param)
Definition swell-dlg-generic.cpp:150
void SWELL_SetDefaultWindowMenu(HMENU menu)
Definition swell-dlg-generic.cpp:361
HWND SWELL_CreateDialog(SWELL_DialogResourceIndex *reshead, const char *resid, HWND parent, DLGPROC dlgproc, LPARAM param)
Definition swell-dlg-generic.cpp:272
void SWELL_SetDefaultModalWindowMenu(HMENU menu)
Definition swell-dlg-generic.cpp:369
HMENU SWELL_GetDefaultModalWindowMenu()
Definition swell-dlg-generic.cpp:365
HMENU SWELL_GetDefaultWindowMenu()
Definition swell-dlg-generic.cpp:360
#define SWELL_EnableMetal(hwnd, x)
const char const char const char const char char * fn
Definition swell-functions.h:168
const char * text
Definition swell-functions.h:167
#define SWELL_API_DEFINE(ret, func, parms)
Definition swell-functions.h:42
CreateThread
Definition swell-functions.h:807
RECT const char void HWND BOOL(* cwEnumFunc)(HWND, LPARAM)
Definition swell-functions.h:1066
BrowseForSaveFile
Definition swell-functions.h:167
const char const char * initialdir
Definition swell-functions.h:167
RECT const char * srcfn
Definition swell-functions.h:1004
void DWORD DWORD LPVOID DWORD cf
Definition swell-functions.h:807
RECT const char void EnumChildWindows
Definition swell-functions.h:1066
const char const char const char * initialfile
Definition swell-functions.h:167
void DWORD DWORD LPVOID parm
Definition swell-functions.h:807
RECT const char void(* callback)(const char *droppath))) SWELL_API_DEFINE(BOOL
Definition swell-functions.h:1004
void DWORD stackSize
Definition swell-functions.h:807
RECT * srcrect
Definition swell-functions.h:1004
void DWORD DWORD(* ThreadProc)(LPVOID)
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
void * TA
Definition swell-functions.h:807
SWELL_InitiateDragDrop
Definition swell-functions.h:1004
void StretchBlt(HDC hdcOut, int x, int y, int w, int h, HDC hdcIn, int xin, int yin, int srcw, int srch, int mode)
Definition swell-gdi-generic.cpp:502
HGDIOBJ SelectObject(HDC ctx, HGDIOBJ pen)
Definition swell-gdi-generic.cpp:193
HPEN CreatePenAlpha(int attr, int wid, int col, float alpha)
Definition swell-gdi-generic.cpp:119
HBRUSH CreateSolidBrushAlpha(int col, float alpha)
Definition swell-gdi-generic.cpp:127
HIMAGELIST ImageList_CreateEx()
Definition swell-gdi-generic.cpp:581
void DrawImageInRect(HDC ctx, HICON img, const RECT *r)
Definition swell-gdi-generic.cpp:462
HICON LoadNamedImage(const char *name, bool alphaFromMask)
Definition swell-gdi-generic.cpp:457
BOOL ImageList_Remove(HIMAGELIST list, int idx)
Definition swell-gdi-generic.cpp:585
void Rectangle(HDC ctx, int l, int t, int r, int b)
Definition swell-gdi-generic.cpp:279
void BitBlt(HDC hdcOut, int x, int y, int w, int h, HDC hdcIn, int xin, int yin, int mode)
Definition swell-gdi-generic.cpp:498
int ImageList_ReplaceIcon(HIMAGELIST list, int offset, HICON image)
Definition swell-gdi-generic.cpp:620
void SWELL_FillDialogBackground(HDC hdc, const RECT *r, int level)
Definition swell-gdi-generic.cpp:548
int AddFontResourceEx(LPCTSTR str, DWORD fl, void *pdv)
Definition swell-gdi-generic.cpp:669
void * SWELL_GetCtxFrameBuffer(HDC ctx)
Definition swell-gdi-generic.cpp:526
void StretchBltFromMem(HDC hdcOut, int x, int y, int w, int h, const void *bits, int srcw, int srch, int srcspan)
Definition swell-gdi-generic.cpp:506
BOOL GetTextMetrics(HDC ctx, TEXTMETRIC *tm)
Definition swell-gdi-generic.cpp:398
void DeleteObject(HGDIOBJ pen)
Definition swell-gdi-generic.cpp:173
int ImageList_Add(HIMAGELIST list, HBITMAP image, HBITMAP mask)
Definition swell-gdi-generic.cpp:649
void ImageList_Destroy(HIMAGELIST list)
Definition swell-gdi-generic.cpp:612
int SWELL_GetScaling256(void)
Definition swell-gdi-generic.cpp:62
HFONT CreateFont(int lfHeight, int lfWidth, int lfEscapement, int lfOrientation, int lfWeight, char lfItalic, char lfUnderline, char lfStrikeOut, char lfCharSet, char lfOutPrecision, char lfClipPrecision, char lfQuality, char lfPitchAndFamily, const char *lfFaceName)
Definition swell-gdi-generic.cpp:137
void PolyBezierTo(HDC ctx, POINT *pts, int np)
Definition swell-gdi-generic.cpp:336
HBITMAP CreateBitmap(int width, int height, int numplanes, int bitsperpixel, unsigned char *bits)
Definition swell-gdi-generic.cpp:572
void SetBkMode(HDC ctx, int col)
Definition swell-gdi-generic.cpp:436
HDC BeginPaint(HWND hwnd, PAINTSTRUCT *ps)
Definition swell-gdi-generic.cpp:562
HDC GetWindowDC(HWND h)
Definition swell-gdi-generic.cpp:539
void SWELL_SetClipRegion(HDC ctx, const RECT *r)
Definition swell-gdi-generic.cpp:515
void MoveToEx(HDC ctx, int x, int y, POINT *op)
Definition swell-gdi-generic.cpp:323
HGDIOBJ GetStockObject(int wh)
Definition swell-gdi-generic.cpp:292
int GetTextColor(HDC ctx)
Definition swell-gdi-generic.cpp:442
int GetTextFace(HDC ctx, int nCount, LPTSTR lpFaceName)
Definition swell-gdi-generic.cpp:167
void Ellipse(HDC ctx, int l, int t, int r, int b)
Definition swell-gdi-generic.cpp:264
HPEN CreatePen(int attr, int wid, int col)
Definition swell-gdi-generic.cpp:109
void SWELL_DeleteGfxContext(HDC ctx)
Definition swell-gdi-generic.cpp:97
void SWELL_PopClipRegion(HDC ctx)
Definition swell-gdi-generic.cpp:521
int GetSysColor(int idx)
Definition swell-gdi-generic.cpp:42
void SWELL_FillRect(HDC ctx, const RECT *r, HBRUSH br)
Definition swell-gdi-generic.cpp:233
void SetBkColor(HDC ctx, int col)
Definition swell-gdi-generic.cpp:429
HBRUSH CreateSolidBrush(int col)
Definition swell-gdi-generic.cpp:114
HGDIOBJ SWELL_CloneGDIObject(HGDIOBJ a)
Definition swell-gdi-generic.cpp:552
void SetTextColor(HDC ctx, int col)
Definition swell-gdi-generic.cpp:449
void * SWELL_GetCtxGC(HDC ctx)
Definition swell-gdi-generic.cpp:383
void RoundRect(HDC ctx, int x, int y, int x2, int y2, int xrnd, int yrnd)
Definition swell-gdi-generic.cpp:244
int GetGlyphIndicesW(HDC ctx, wchar_t *buf, int len, unsigned short *indices, int flags)
Definition swell-gdi-generic.cpp:674
HICON CreateIconIndirect(ICONINFO *iconinfo)
Definition swell-gdi-generic.cpp:577
HDC GetDC(HWND h)
Definition swell-gdi-generic.cpp:534
BOOL GetObject(HICON icon, int bmsz, void *_bm)
Definition swell-gdi-generic.cpp:479
HDC SWELL_CreateMemContext(HDC hdc, int w, int h)
Definition swell-gdi-generic.cpp:82
void SWELL_PushClipRegion(HDC ctx)
Definition swell-gdi-generic.cpp:510
HFONT CreateFontIndirect(LOGFONT *lf)
Definition swell-gdi-generic.cpp:160
void ReleaseDC(HWND h, HDC hdc)
Definition swell-gdi-generic.cpp:544
void PolyPolyline(HDC ctx, POINT *pts, DWORD *cnts, int nseg)
Definition swell-gdi-generic.cpp:364
WORD GetAsyncKeyState(int key)
Definition swell-generic-headless.cpp:218
void SWELL_initargs(int *argc, char ***argv)
Definition swell-generic-headless.cpp:70
void SWELL_Register_Cursor_Resource(const char *idx, const char *name, int hotspot_x, int hotspot_y)
Definition swell-generic-headless.cpp:296
void SWELL_SetCursor(HCURSOR curs)
Definition swell-generic-headless.cpp:250
BOOL SWELL_SetCursorPos(int X, int Y)
Definition swell-generic-headless.cpp:276
HANDLE GetClipboardData(UINT type)
Definition swell-generic-headless.cpp:177
HCURSOR SWELL_GetCursor()
Definition swell-generic-headless.cpp:255
bool GetWindowRect(HWND hwnd, RECT *r)
Definition swell-generic-headless.cpp:130
bool SWELL_IsCursorVisible()
Definition swell-generic-headless.cpp:265
void SetClipboardData(UINT type, HANDLE h)
Definition swell-generic-headless.cpp:188
void SWELL_GetViewPort(RECT *r, const RECT *sourcerect, bool wantWork)
Definition swell-generic-headless.cpp:122
bool OpenClipboard(HWND hwndDlg)
Definition swell-generic-headless.cpp:156
void GetCursorPos(POINT *pt)
Definition swell-generic-headless.cpp:211
UINT RegisterClipboardFormat(const char *desc)
Definition swell-generic-headless.cpp:194
int SWELL_KeyToASCII(int wParam, int lParam, int *newflags)
Definition swell-generic-headless.cpp:308
void CloseClipboard()
Definition swell-generic-headless.cpp:162
HCURSOR SWELL_LoadCursorFromFile(const char *fn)
Definition swell-generic-headless.cpp:281
HCURSOR SWELL_GetLastSetCursor()
Definition swell-generic-headless.cpp:259
HWND SWELL_CreateXBridgeWindow(HWND viewpar, void **wref, const RECT *r)
Definition swell-generic-headless.cpp:229
void EmptyClipboard()
Definition swell-generic-headless.cpp:183
UINT EnumClipboardFormats(UINT lastfmt)
Definition swell-generic-headless.cpp:164
void SWELL_FinishDragDrop()
Definition swell-generic-headless.cpp:246
void SWELL_InitiateDragDropOfFileList(HWND hwnd, RECT *srcrect, const char **srclist, int srccount, HICON icon)
Definition swell-generic-headless.cpp:242
int SWELL_ShowCursor(BOOL bShow)
Definition swell-generic-headless.cpp:270
HCURSOR SWELL_LoadCursor(const char *_idx)
Definition swell-generic-headless.cpp:289
void UpdateWindow(HWND hwnd)
Definition swell-generic-headless.cpp:151
int SWELL_SetWindowLevel(HWND hwnd, int newlevel)
Definition swell-generic-headless.cpp:111
DWORD GetMessagePos()
Definition swell-generic-headless.cpp:224
DWORD GetPrivateProfileSection(const char *appname, char *strout, DWORD strout_len, const char *fn)
Definition swell-ini.cpp:406
DWORD GetPrivateProfileString(const char *appname, const char *keyname, const char *def, char *ret, int retsize, const char *fn)
Definition swell-ini.cpp:458
BOOL GetPrivateProfileStruct(const char *appname, const char *keyname, void *buf, int bufsz, const char *fn)
Definition swell-ini.cpp:554
BOOL WritePrivateProfileStruct(const char *appname, const char *keyname, const void *buf, int bufsz, const char *fn)
Definition swell-ini.cpp:582
int GetPrivateProfileInt(const char *appname, const char *keyname, int def, const char *fn)
Definition swell-ini.cpp:524
BOOL WritePrivateProfileString(const char *appname, const char *keyname, const char *val, const char *fn)
Definition swell-ini.cpp:333
BOOL WritePrivateProfileSection(const char *appname, const char *strings, const char *fn)
Definition swell-ini.cpp:293
void SWELL_InsertMenu(HMENU menu, int pos, unsigned int flag, UINT_PTR idx, const char *str)
Definition swell-menu-generic.cpp:283
void DrawMenuBar(HWND hwnd)
Definition swell-menu-generic.cpp:1353
HMENU SWELL_GetCurrentMenu()
Definition swell-menu-generic.cpp:121
void SWELL_Menu_AddMenuItem(HMENU hMenu, const char *name, int idx, unsigned int flags)
Definition swell-menu-generic.cpp:1280
int GetMenuItemCount(HMENU hMenu)
Definition swell-menu-generic.cpp:136
BOOL GetMenuItemInfo(HMENU hMenu, int pos, BOOL byPos, MENUITEMINFO *mi)
Definition swell-menu-generic.cpp:257
BOOL SetMenuItemInfo(HMENU hMenu, int pos, BOOL byPos, MENUITEMINFO *mi)
Definition swell-menu-generic.cpp:220
HMENU SWELL_LoadMenu(SWELL_MenuResourceIndex *head, const char *resid)
Definition swell-menu-generic.cpp:1306
int TrackPopupMenu(HMENU hMenu, int flags, int xpos, int ypos, int resvd, HWND hwnd, const RECT *r)
Definition swell-menu-generic.cpp:1203
HMENU CreatePopupMenuEx(const char *title)
Definition swell-menu-generic.cpp:163
bool SetMenuItemText(HMENU hMenu, int idx, int flag, const char *text)
Definition swell-menu-generic.cpp:86
bool SetMenuItemModifier(HMENU hMenu, int idx, int flag, int code, unsigned int mask)
Definition swell-menu-generic.cpp:154
int SWELL_GenerateMenuFromList(HMENU hMenu, const void *_list, int listsz)
Definition swell-menu-generic.cpp:1367
void SWELL_SetCurrentMenu(HMENU hmenu)
Definition swell-menu-generic.cpp:125
bool CheckMenuItem(HMENU hMenu, int idx, int chk)
Definition swell-menu-generic.cpp:110
int GetMenuItemID(HMENU hMenu, int pos)
Definition swell-menu-generic.cpp:142
bool DeleteMenu(HMENU hMenu, int idx, int flag)
Definition swell-menu-generic.cpp:184
HMENU GetSubMenu(HMENU hMenu, int pos)
Definition swell-menu-generic.cpp:129
bool EnableMenuItem(HMENU hMenu, int idx, int en)
Definition swell-menu-generic.cpp:98
void SWELL_SetMenuDestination(HMENU menu, HWND hwnd)
Definition swell-menu-generic.cpp:347
int AddMenuItem(HMENU hMenu, int pos, const char *name, int tagid)
Definition swell-menu-generic.cpp:173
HMENU CreatePopupMenu()
Definition swell-menu-generic.cpp:159
HMENU GetMenu(HWND hwnd)
Definition swell-menu-generic.cpp:1347
void DestroyMenu(HMENU hMenu)
Definition swell-menu-generic.cpp:168
BOOL SetMenu(HWND hwnd, HMENU menu)
Definition swell-menu-generic.cpp:1322
void InsertMenuItem(HMENU hMenu, int pos, BOOL byPos, MENUITEMINFO *mi)
Definition swell-menu-generic.cpp:311
HMENU SWELL_DuplicateMenu(HMENU menu)
Definition swell-menu-generic.cpp:1316
int SWELL_GetProcessExitCode(HANDLE hand)
Definition swell-misc-generic.cpp:70
BOOL EnumDisplayMonitors(HDC hdc, const LPRECT r, MONITORENUMPROC proc, LPARAM lParam)
Definition swell-misc-generic.cpp:85
void SWELL_EnableRightClickEmulate(BOOL enable)
Definition swell-misc-generic.cpp:36
HANDLE SWELL_CreateProcessFromPID(int pid)
Definition swell-misc-generic.cpp:41
HANDLE SWELL_CreateProcess(const char *exe, int nparams, const char **params)
Definition swell-misc-generic.cpp:51
BOOL GetMonitorInfo(HMONITOR hmon, void *inf)
Definition swell-misc-generic.cpp:89
bool SWELL_ChooseColor(HWND h, COLORREF *val, int ncustom, COLORREF *custom)
Definition swell-miscdlg-generic.cpp:1708
bool BrowseForDirectory(const char *text, const char *initialdir, char *fn, int fnsize)
Definition swell-miscdlg-generic.cpp:1095
int MessageBox(HWND hwndParent, const char *text, const char *caption, int type)
Definition swell-miscdlg-generic.cpp:1270
bool SWELL_ChooseFont(HWND h, LOGFONT *lf)
Definition swell-miscdlg-generic.cpp:2045
void BrowseFile_SetTemplate(const char *dlgid, DLGPROC dlgProc, struct SWELL_DialogResourceIndex *reshead)
Definition swell-miscdlg-generic.cpp:116
char * BrowseForFiles(const char *text, const char *initialdir, const char *initialfile, bool allowmul, const char *extlist)
Definition swell-miscdlg-generic.cpp:1102
struct HGDIOBJ__ * HPEN
Definition swell-types.h:271
void * HINSTANCE
Definition swell-types.h:212
unsigned short WORD
Definition swell-types.h:163
HWND(* SWELL_ControlCreatorProc)(HWND parent, const char *cname, int idx, const char *classname, int style, int x, int y, int w, int h)
Definition swell-types.h:642
struct RECT * LPRECT
uintptr_t UINT_PTR
Definition swell-types.h:43
LONG_PTR LRESULT
Definition swell-types.h:171
BOOL(* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM)
Definition swell-types.h:1459
unsigned int UINT
Definition swell-types.h:166
struct TVITEM * LPTVITEM
LONG_PTR LPARAM
Definition swell-types.h:170
signed char BOOL
Definition swell-types.h:160
void * HMONITOR
Definition swell-types.h:1443
struct POINT * LPPOINT
intptr_t LONG_PTR
Definition swell-types.h:42
struct TVINSERTSTRUCT TV_INSERTSTRUCT
struct HIMAGELIST__ * HIMAGELIST
Definition swell-types.h:309
struct HGDIOBJ__ * HBRUSH
Definition swell-types.h:270
unsigned int DWORD
Definition swell-types.h:164
void * HDROP
Definition swell-types.h:212
int(* PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM)
Definition swell-types.h:307
ULONG_PTR WPARAM
Definition swell-types.h:169
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
BOOL(* PROPENUMPROCEX)(HWND hwnd, const char *lpszString, HANDLE hData, LPARAM lParam)
Definition swell-types.h:639
void * HANDLE
Definition swell-types.h:212
struct HGDIOBJ__ * HGDIOBJ
Definition swell-types.h:269
void * LPVOID
Definition swell-types.h:174
struct tagGESTUREINFO GESTUREINFO
struct HGDIOBJ__ * HBITMAP
Definition swell-types.h:267
struct HCURSOR__ * HCURSOR
Definition swell-types.h:264
struct HWND__ * HWND
Definition swell-types.h:210
struct HGDIOBJ__ * HICON
Definition swell-types.h:268
DWORD COLORREF
Definition swell-types.h:165
char * LPTSTR
Definition swell-types.h:189
struct HDC__ * HDC
Definition swell-types.h:263
INT_PTR(* DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition swell-types.h:586
struct _ICONINFO ICONINFO
const char * LPCTSTR
Definition swell-types.h:190
int ListView_InsertItem(HWND h, const LVITEM *item)
Definition swell-wnd-generic.cpp:6272
BOOL ShellExecute(HWND hwndDlg, const char *action, const char *content1, const char *content2, const char *content3, int blah)
Definition swell-wnd-generic.cpp:8207
HWND SetCapture(HWND hwnd)
Definition swell-wnd-generic.cpp:6934
void SWELL_MessageQueue_Flush()
Definition swell-wnd-generic.cpp:7600
BOOL SWELL_GetGestureInfo(LPARAM lParam, GESTUREINFO *gi)
Definition swell-wnd-generic.cpp:8360
LONG_PTR GetWindowLong(HWND hwnd, int idx)
Definition swell-wnd-generic.cpp:235
HTREEITEM TreeView_GetSelection(HWND hwnd)
Definition swell-wnd-generic.cpp:7847
BOOL Header_GetItem(HWND h, int col, HDITEM *hi)
Definition swell-wnd-generic.cpp:8141
void TreeView_DeleteAllItems(HWND hwnd)
Definition swell-wnd-generic.cpp:7869
HTREEITEM TreeView_GetParent(HWND hwnd, HTREEITEM item)
Definition swell-wnd-generic.cpp:7996
HWND WindowFromPoint(POINT p)
Definition swell-wnd-generic.cpp:6829
void DragFinish(HDROP hDrop)
Definition swell-wnd-generic.cpp:7516
BOOL EnumWindows(BOOL(*proc)(HWND, LPARAM), LPARAM lp)
Definition swell-wnd-generic.cpp:725
HTREEITEM TreeView_GetNextSibling(HWND hwnd, HTREEITEM item)
Definition swell-wnd-generic.cpp:8014
BOOL TreeView_SetItem(HWND hwnd, LPTVITEM pitem)
Definition swell-wnd-generic.cpp:7928
UINT DragQueryFile(HDROP hDrop, UINT wf, char *buf, UINT bufsz)
Definition swell-wnd-generic.cpp:7521
BOOL SetDlgItemText(HWND hwnd, int idx, const char *text)
Definition swell-wnd-generic.cpp:962
BOOL SWELL_IsStaticText(HWND hwnd)
Definition swell-wnd-generic.cpp:8201
void SWELL_UnregisterCustomControlCreator(SWELL_ControlCreatorProc proc)
Definition swell-wnd-generic.cpp:5989
LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:7223
int SWELL_GetWindowWantRaiseAmt(HWND h)
Definition swell-wnd-generic.cpp:8368
void SetAllowNoMiddleManRendering(HWND h, bool allow)
Definition swell-wnd-generic.cpp:8348
void ListView_SetTextBkColor(HWND h, int color)
Definition swell-wnd-generic.cpp:8048
void TreeView_EnsureVisible(HWND hwnd, HTREEITEM item)
Definition swell-wnd-generic.cpp:7878
int ListView_GetColumnWidth(HWND h, int pos)
Definition swell-wnd-generic.cpp:6225
void EnableWindow(HWND hwnd, int enable)
Definition swell-wnd-generic.cpp:473
int ListView_GetNextItem(HWND h, int istart, int flags)
Definition swell-wnd-generic.cpp:6308
void SetForegroundWindow(HWND hwnd)
Definition swell-wnd-generic.cpp:489
bool ListView_GetItem(HWND h, LVITEM *item)
Definition swell-wnd-generic.cpp:6365
int GetSystemMetrics(int p)
Definition swell-wnd-generic.cpp:7734
int ListView_SubItemHitTest(HWND h, LVHITTESTINFO *pinf)
Definition swell-wnd-generic.cpp:6604
bool ListView_DeleteColumn(HWND h, int pos)
Definition swell-wnd-generic.cpp:6728
void * SWELL_ModalWindowStart(HWND hwnd)
Definition swell-wnd-generic.cpp:1063
void ListView_SetImageList(HWND h, HIMAGELIST imagelist, int which)
Definition swell-wnd-generic.cpp:6217
HWND SWELL_MakeButton(int def, const char *label, int idx, int x, int y, int w, int h, int flags)
these are for swell-dlggen.h
Definition swell-wnd-generic.cpp:3765
BOOL SWELL_IsButton(HWND hwnd)
Definition swell-wnd-generic.cpp:8197
void SWELL_BroadcastMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:8333
int GetClassName(HWND hwnd, char *buf, int bufsz)
Definition swell-wnd-generic.cpp:8427
void ListView_SortItems(HWND hwnd, PFNLVCOMPARE compf, LPARAM parm)
Definition swell-wnd-generic.cpp:6713
UINT_PTR SetTimer(HWND hwnd, UINT_PTR timerid, UINT rate, TIMERPROC tProc)
Definition swell-wnd-generic.cpp:875
void ListView_RedrawItems(HWND h, int startitem, int enditem)
Definition swell-wnd-generic.cpp:6493
void TreeView_SelectItem(HWND hwnd, HTREEITEM item)
Definition swell-wnd-generic.cpp:7887
HTREEITEM TreeView_InsertItem(HWND hwnd, TV_INSERTSTRUCT *ins)
Definition swell-wnd-generic.cpp:7792
void SWELL_SetClassName(HWND hwnd, const char *p)
Definition swell-wnd-generic.cpp:8421
int ListView_GetItemCount(HWND h)
Definition swell-wnd-generic.cpp:6525
void SWELL_RunMessageLoop()
Definition swell-wnd-generic.cpp:836
void SWELL_GetDesiredControlSize(HWND hwnd, RECT *r)
Definition swell-wnd-generic.cpp:8189
BOOL SetDlgItemInt(HWND hwnd, int idx, int val, int issigned)
Definition swell-wnd-generic.cpp:1011
void ListView_DeleteItem(HWND h, int ipos)
Definition swell-wnd-generic.cpp:6499
LRESULT SendMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:315
HWND SWELL_MakeLabel(int align, const char *label, int idx, int x, int y, int w, int h, int flags)
Definition swell-wnd-generic.cpp:3779
HWND SWELL_MakeControl(const char *cname, int idx, const char *classname, int style, int x, int y, int w, int h, int exstyle)
Definition swell-wnd-generic.cpp:6015
void ListView_SetColumn(HWND h, int pos, const LVCOLUMN *lvc)
Definition swell-wnd-generic.cpp:6252
HWND GetCapture()
Definition swell-wnd-generic.cpp:6929
BOOL ListView_GetColumnOrderArray(HWND h, int cnt, int *arr)
Definition swell-wnd-generic.cpp:8093
int TabCtrl_GetItemCount(HWND hwnd)
Definition swell-wnd-generic.cpp:6146
bool ListView_Scroll(HWND h, int xscroll, int yscroll)
Definition swell-wnd-generic.cpp:6700
HWND GetWindow(HWND hwnd, int what)
Definition swell-wnd-generic.cpp:737
void SWELL_ModalWindowEnd(void *ctx)
Definition swell-wnd-generic.cpp:1073
HWND SetParent(HWND hwnd, HWND newPar)
Definition swell-wnd-generic.cpp:758
void TreeView_SetBkColor(HWND hwnd, int color)
Definition swell-wnd-generic.cpp:8029
void DestroyWindow(HWND hwnd)
Definition swell-wnd-generic.cpp:449
BOOL TabCtrl_DeleteItem(HWND hwnd, int idx)
Definition swell-wnd-generic.cpp:6162
HWND GetDlgItem(HWND hwnd, int idx)
Definition swell-wnd-generic.cpp:153
BOOL TabCtrl_AdjustRect(HWND hwnd, BOOL fLarger, RECT *r)
Definition swell-wnd-generic.cpp:6152
int TabCtrl_SetCurSel(HWND hwnd, int idx)
Definition swell-wnd-generic.cpp:6189
BOOL ScrollWindow(HWND hwnd, int xamt, int yamt, const RECT *lpRect, const RECT *lpClipRect)
Definition swell-wnd-generic.cpp:7754
HWND SWELL_MakeListBox(int idx, int x, int y, int w, int h, int styles)
Definition swell-wnd-generic.cpp:5944
bool ListView_GetSubItemRect(HWND h, int item, int subitem, int code, RECT *r)
Definition swell-wnd-generic.cpp:6657
int SWELL_GetDefaultButtonID(HWND hwndDlg, bool onlyIfEnabled)
Definition swell-wnd-generic.cpp:8351
int ListView_GetTopIndex(HWND h)
Definition swell-wnd-generic.cpp:8087
BOOL Header_SetItem(HWND h, int col, HDITEM *hi)
Definition swell-wnd-generic.cpp:8158
HWND FindWindowEx(HWND par, HWND lastw, const char *classname, const char *title)
Definition swell-wnd-generic.cpp:7773
HWND GetFocus()
Definition swell-wnd-generic.cpp:572
int GetWindowTextLength(HWND hwnd)
Definition swell-wnd-generic.cpp:979
void SWELL_SetWindowWantRaiseAmt(HWND h, int amt)
Definition swell-wnd-generic.cpp:8365
BOOL TreeView_GetItem(HWND hwnd, LPTVITEM pitem)
Definition swell-wnd-generic.cpp:7910
void SetWindowPos(HWND hwnd, HWND zorder, int x, int y, int cx, int cy, int flags)
Definition swell-wnd-generic.cpp:637
void SWELL_DrawFocusRect(HWND hwndPar, RECT *rct, void **handle)
Definition swell-wnd-generic.cpp:8299
bool IsWindowVisible(HWND hwnd)
Definition swell-wnd-generic.cpp:302
HWND SWELL_MakeCheckBox(const char *name, int idx, int x, int y, int w, int h, int flags=0)
Definition swell-wnd-generic.cpp:3805
bool IsWindowEnabled(HWND hwnd)
Definition swell-wnd-generic.cpp:463
HWND ListView_GetHeader(HWND h)
Definition swell-wnd-generic.cpp:8130
bool ListView_GetItemRect(HWND h, int item, RECT *r, int code)
Definition swell-wnd-generic.cpp:6695
void TreeView_DeleteItem(HWND hwnd, HTREEITEM item)
Definition swell-wnd-generic.cpp:7855
void ListView_SetItemCount(HWND h, int cnt)
Definition swell-wnd-generic.cpp:6624
void ListView_SetGridColor(HWND h, int color)
Definition swell-wnd-generic.cpp:8059
bool SWELL_ModalWindowRun(void *ctx, int *ret)
Definition swell-wnd-generic.cpp:1068
HWND SWELL_MakeEditField(int idx, int x, int y, int w, int h, int flags)
Definition swell-wnd-generic.cpp:3792
HWND GetParent(HWND hwnd)
Definition swell-wnd-generic.cpp:144
void ListView_DeleteAllItems(HWND h)
Definition swell-wnd-generic.cpp:6507
void SWELL_HideApp()
Definition swell-wnd-generic.cpp:8356
int ListView_GetCountPerPage(HWND h)
Definition swell-wnd-generic.cpp:6749
void SWELL_CloseWindow(HWND hwnd)
Definition swell-wnd-generic.cpp:1080
void SWELL_MessageQueue_Clear(HWND h)
Definition swell-wnd-generic.cpp:7567
int IsDlgButtonChecked(HWND hwnd, int idx)
Definition swell-wnd-generic.cpp:1003
int IsChild(HWND hwndParent, HWND hwndChild)
Definition swell-wnd-generic.cpp:538
int GetDlgItemInt(HWND hwnd, int idx, BOOL *translated, int issigned)
Definition swell-wnd-generic.cpp:1018
HTREEITEM TreeView_HitTest(HWND hwnd, TVHITTESTINFO *hti)
Definition swell-wnd-generic.cpp:7970
HWND SWELL_MakeCombo(int idx, int x, int y, int w, int h, int flags)
Definition swell-wnd-generic.cpp:6119
HWND GetForegroundWindow()
Definition swell-wnd-generic.cpp:567
void SWELL_DisableContextMenu(HWND hwnd, bool dis)
Definition swell-wnd-generic.cpp:8434
void ListView_SetColumnWidth(HWND h, int pos, int wid)
Definition swell-wnd-generic.cpp:6547
void ScreenToClient(HWND hwnd, POINT *pt)
Definition swell-wnd-generic.cpp:580
void SetFocus(HWND hwnd)
Definition swell-wnd-generic.cpp:506
bool ListView_SetItemState(HWND h, int ipos, UINT state, UINT statemask)
Definition swell-wnd-generic.cpp:6434
BOOL DragQueryPoint(HDROP hDrop, LPPOINT pt)
Definition swell-wnd-generic.cpp:7506
LONG_PTR SetWindowLong(HWND hwnd, int idx, LONG_PTR val)
Definition swell-wnd-generic.cpp:163
void SWELL_SetListViewFastClickMask(HWND hList, int mask)
Definition swell-wnd-generic.cpp:6213
BOOL SWELL_IsGroupBox(HWND hwnd)
Definition swell-wnd-generic.cpp:8193
int ListView_HitTest(HWND h, LVHITTESTINFO *pinf)
Definition swell-wnd-generic.cpp:6560
bool ListView_SetItem(HWND h, LVITEM *item)
Definition swell-wnd-generic.cpp:6321
BOOL EndPaint(HWND hwnd, PAINTSTRUCT *ps)
Definition swell-wnd-generic.cpp:7082
HANDLE RemoveProp(HWND hwnd, const char *name)
Definition swell-wnd-generic.cpp:7725
BOOL TreeView_SetIndent(HWND hwnd, int indent)
Definition swell-wnd-generic.cpp:8024
void ListView_SetExtendedListViewStyleEx(HWND h, int flag, int mask)
Definition swell-wnd-generic.cpp:6206
HWND SWELL_MakeGroupBox(const char *name, int idx, int x, int y, int w, int h, int style)
Definition swell-wnd-generic.cpp:6133
int TabCtrl_InsertItem(HWND hwnd, int idx, TCITEM *item)
Definition swell-wnd-generic.cpp:6175
BOOL KillTimer(HWND hwnd, UINT_PTR timerid)
Definition swell-wnd-generic.cpp:923
BOOL SetProp(HWND hwnd, const char *name, HANDLE val)
Definition swell-wnd-generic.cpp:7718
void ListView_EnsureVisible(HWND h, int i, BOOL pok)
Definition swell-wnd-generic.cpp:6633
HTREEITEM TreeView_GetRoot(HWND hwnd)
Definition swell-wnd-generic.cpp:7989
void SWELL_GenerateDialogFromList(const void *_list, int listsz)
Definition swell-wnd-generic.cpp:8374
BOOL ListView_SetColumnOrderArray(HWND h, int cnt, int *arr)
Definition swell-wnd-generic.cpp:8103
void SWELL_Internal_PostMessage_Init()
Definition swell-wnd-generic.cpp:7596
void ClientToScreen(HWND hwnd, POINT *pt)
Definition swell-wnd-generic.cpp:596
void ReleaseCapture()
Definition swell-wnd-generic.cpp:6946
int SWELL_GetListViewHeaderHeight(HWND h)
Definition swell-wnd-generic.cpp:6541
void ListView_InsertColumn(HWND h, int pos, const LVCOLUMN *lvc)
Definition swell-wnd-generic.cpp:6233
void SetOpaque(HWND h, bool opaque)
Definition swell-wnd-generic.cpp:8345
BOOL InvalidateRect(HWND hwnd, const RECT *r, int eraseBk)
Definition swell-wnd-generic.cpp:6848
BOOL TreeView_Expand(HWND hwnd, HTREEITEM item, UINT flag)
Definition swell-wnd-generic.cpp:7825
BOOL PostMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition swell-wnd-generic.cpp:7561
int ListView_GetSelectedCount(HWND h)
Definition swell-wnd-generic.cpp:6515
int ListView_GetItemState(HWND h, int ipos, UINT mask)
Definition swell-wnd-generic.cpp:6418
void ListView_SetBkColor(HWND h, int color)
Definition swell-wnd-generic.cpp:8040
int ListView_GetSelectionMark(HWND h)
Definition swell-wnd-generic.cpp:6532
void ListView_SetTextColor(HWND h, int color)
Definition swell-wnd-generic.cpp:8051
int Header_GetItemCount(HWND h)
Definition swell-wnd-generic.cpp:8135
HANDLE GetProp(HWND hwnd, const char *name)
Definition swell-wnd-generic.cpp:7712
void GetClientRect(HWND hwnd, RECT *r)
Definition swell-wnd-generic.cpp:621
void SWELL_MakeSetCurParms(float xscale, float yscale, float xtrans, float ytrans, HWND parent, bool doauto, bool dosizetofit)
Definition swell-wnd-generic.cpp:1129
void ListView_GetItemText(HWND hwnd, int item, int subitem, char *text, int textmax)
Definition swell-wnd-generic.cpp:6266
void ListView_SetItemText(HWND h, int ipos, int cpos, const char *txt)
Definition swell-wnd-generic.cpp:6293
void ListView_SetSelColors(HWND h, int *colors, int ncolors)
Definition swell-wnd-generic.cpp:8067
void ShowWindow(HWND hwnd, int cmd)
Definition swell-wnd-generic.cpp:1034
void GetWindowContentViewRect(HWND hwnd, RECT *r)
Definition swell-wnd-generic.cpp:611
void SWELL_RegisterCustomControlCreator(SWELL_ControlCreatorProc proc)
Definition swell-wnd-generic.cpp:5965
HTREEITEM TreeView_GetChild(HWND hwnd, HTREEITEM item)
Definition swell-wnd-generic.cpp:8007
int EnumPropsEx(HWND hwnd, PROPENUMPROCEX proc, LPARAM lParam)
Definition swell-wnd-generic.cpp:7699
void TreeView_SetTextColor(HWND hwnd, int color)
Definition swell-wnd-generic.cpp:8033
bool IsWindow(HWND hwnd)
Definition swell-wnd-generic.cpp:289
BOOL GetDlgItemText(HWND hwnd, int idx, char *text, int textlen)
Definition swell-wnd-generic.cpp:984
void CheckDlgButton(HWND hwnd, int idx, int check)
Definition swell-wnd-generic.cpp:995
int TabCtrl_GetCurSel(HWND hwnd)
Definition swell-wnd-generic.cpp:6200
DWORD GetTickCount()
Definition swell.cpp:68
HINSTANCE LoadLibrary(const char *fn)
Definition swell.cpp:793
void GlobalUnlock(HANDLE h)
Definition swell.cpp:739
HANDLE GlobalAlloc(int flags, int sz)
Definition swell.cpp:756
bool SWELL_GenerateGUID(void *g)
Definition swell.cpp:1042
void * GlobalLock(HANDLE h)
Definition swell.cpp:725
HINSTANCE LoadLibraryGlobals(const char *fn, bool symbolsAsGlobals)
Definition swell.cpp:805
unsigned int _controlfp(unsigned int flag, unsigned int mask)
Definition swell.cpp:126
int GlobalSize(HANDLE h)
Definition swell.cpp:732
DWORD WaitForSingleObject(HANDLE hand, DWORD msTO)
Definition swell.cpp:297
int MulDiv(int a, int b, int c)
Definition swell.cpp:120
void Sleep(int ms)
Definition swell.cpp:63
void * SWELL_ExtendedAPI(const char *key, void *v)
Definition swell.cpp:1096
BOOL ResetEvent(HANDLE hand)
Definition swell.cpp:634
void GetTempPath(int bufsz, char *buf)
Definition swell.cpp:1063
HANDLE CreateEvent(void *SA, BOOL manualReset, BOOL initialSig, const char *ignored)
Definition swell.cpp:476
BOOL SWELL_PtInRect(const RECT *r, POINT p)
Definition swell.cpp:106
BOOL WinOffsetRect(LPRECT lprc, int dx, int dy)
Definition swell.cpp:660
HANDLE CreateEventAsSocket(void *SA, BOOL manualReset, BOOL initialSig, const char *ignored)
Definition swell.cpp:220
DWORD GetModuleFileName(HINSTANCE hInst, char *fn, DWORD nSize)
Definition swell.cpp:974
BOOL SetEvent(HANDLE hand)
Definition swell.cpp:596
BOOL WinSetRect(LPRECT lprc, int xLeft, int yTop, int xRight, int yBottom)
Definition swell.cpp:670
BOOL SetThreadPriority(HANDLE hand, int prio)
Definition swell.cpp:526
BOOL FreeLibrary(HINSTANCE hInst)
Definition swell.cpp:924
DWORD GetCurrentThreadId()
Definition swell.cpp:471
BOOL GetFileTime(int filedes, FILETIME *lpCreationTime, FILETIME *lpLastAccessTime, FILETIME *lpLastWriteTime)
Definition swell.cpp:93
void WinUnionRect(RECT *out, const RECT *in1, const RECT *in2)
Definition swell.cpp:698
void * SWELL_GetBundle(HINSTANCE hInst)
Definition swell.cpp:962
void * GetProcAddress(HINSTANCE hInst, const char *procName)
Definition swell.cpp:902
char * lstrcpyn(char *dest, const char *src, int l)
Definition swell.cpp:767
void GlobalFree(HANDLE h)
Definition swell.cpp:745
DWORD WaitForAnySocketObject(int numObjs, HANDLE *objs, DWORD msTO)
Definition swell.cpp:246
BOOL CloseHandle(HANDLE hand)
Definition swell.cpp:157
int WinIntersectRect(RECT *out, const RECT *in1, const RECT *in2)
Definition swell.cpp:681
#define SWELL_CB_SetCurSel(hwnd, idx, val)
Definition swell.h:99
#define SWELL_CB_GetCurSel(hwnd, idx)
Definition swell.h:101
#define SWELL_CB_InsertString(hwnd, idx, pos, str)
Definition swell.h:97
#define SWELL_CB_AddString(hwnd, idx, str)
Definition swell.h:98
#define SWELL_TB_SetRange(hwnd, idx, low, hi)
Definition swell.h:109
#define SWELL_CB_GetNumItems(hwnd, idx)
Definition swell.h:100
#define SWELL_TB_SetPos(hwnd, idx, pos)
Definition swell.h:108
#define SWELL_CB_SetItemData(hwnd, idx, item, val)
Definition swell.h:102
#define SWELL_TB_GetPos(hwnd, idx)
Definition swell.h:110
#define SWELL_CB_DeleteString(hwnd, idx, str)
Definition swell.h:106
#define SWELL_TB_SetTic(hwnd, idx, pos)
Definition swell.h:111
#define SWELL_CB_GetItemText(hwnd, idx, item, buf, bufsz)
Definition swell.h:104
#define SWELL_CB_GetItemData(hwnd, idx, item)
Definition swell.h:103
#define SWELL_CB_Empty(hwnd, idx)
Definition swell.h:105
uch * p
Definition crypt.c:594
return c
Definition crypt.c:175
ZCONST char * key
Definition crypt.c:587
int r
Definition crypt.c:458
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
b
Definition crypt.c:628
int flag
Definition unix.c:754
dy
Definition zipinfo.c:2288
int argc
Definition zipinfo.c:455
bool SWELL_GetViewGL(HWND h)
Definition ysfx_api_gfx.cpp:457
bool SWELL_SetGLContextToView(HWND h)
Definition ysfx_api_gfx.cpp:462
void SWELL_SetViewGL(HWND h, char wantGL)
Definition ysfx_api_gfx.cpp:453
#define const
Definition zconf.h:137