Kp
564f699002
Pass UI_DIALOG& to ui_gadget_get_next, ui_gadget_get_prev
2020-10-12 03:28:26 +00:00
Kp
b6a7f63e5d
Pass UI_DIALOG& to ui_gadget_calc_keys
2020-10-12 03:28:26 +00:00
Kp
d7bff3daf3
Pass UI_DIALOG& to ui_dialog_do_gadgets
2020-10-12 03:28:25 +00:00
Kp
f79e0343d9
Pass UI_DIALOG& to ui_gadget_send_event
2020-10-12 03:28:25 +00:00
Kp
b30d60a521
Pass UI_DIALOG& to ui_gadget_add
2020-10-12 03:28:25 +00:00
Kp
b19e0698a1
Simplify out ui_dialog_get_window
...
UI_DIALOG now extends window, so the conversion is implicit.
2020-10-12 03:28:25 +00:00
Kp
1d3e546848
Inline window_get_canvas
...
The helper returns a reference to a mutable canvas, so there is no
isolation provided by using the helper.
2020-08-28 00:18:45 +00:00
Kp
e63bbe8c52
Set d_event type at construction
2018-05-12 18:24:19 +00:00
Kp
adcf02e454
Expand tt:: indirection to std::
...
All supported compilers have an acceptable <type_traits>. Commit
4cb3d46148
("Move <type_traits> test to Cxx11RequiredFeature") made
<type_traits> support mandatory in August and no one has objected.
Remove the indirection and use namespace std directly for type_traits
members.
2017-06-25 20:46:03 +00:00
Kp
9d4e1e307c
Shorten ui_dialog_do_gadgets
2017-03-10 01:22:24 +00:00
Kp
dc881ec12d
Merge pull #266 into master
2016-11-19 18:09:26 +00:00
Kp
98afafb80f
Fix gadget.cpp -Wunused-but-set-variable
...
Commit 917f079
removed all reads of `wind`, but did not remove its
assignment or declaration. This breaks the build with gcc due to
-Wunused-but-set-variable.
Fixes: 917f079f02
("Check for window_event_result::deleted in ui_dialog_do_gadgets")
2016-11-19 17:24:51 +00:00
Chris Taylor
46297c151e
Remove ui_gadget_delete_all
...
As the UI_DIALOG client is now responsible for freeing all gadgets (via unique_ptr's), this function now causes issues where it attempts to access freed gadgets (resulting in std::runtime_error("unknown gadget kind") exception when closing the AI Properties dialog on my Macbook, for example). Removing the offending function fixes the issue.
2016-11-11 16:09:57 +08:00
Chris Taylor
917f079f02
Check for window_event_result::deleted in ui_dialog_do_gadgets
...
This is instead of using window_exists, which could give a false positive if a new window was allocated with the same pointer value as a deleted one.
2016-10-28 08:40:50 +08:00
Kp
e92a7aea14
Use C++ static_cast for gadget downcast
2016-07-06 01:54:25 +00:00
Kp
dc8c0323d8
Uninline namespace dcx
2015-12-13 18:00:49 +00:00
Kp
22bd3ce8d8
Use inline namespace dcx for common/ui
2015-12-05 22:57:24 +00:00
Kp
17b1943c5e
Mark various per-file structures as static
2015-08-12 03:11:46 +00:00
Kp
06c363fb19
Fix UI_GADGET -fno-inline build
...
Fixes: 95e3ac1e5b
("Use integral_constant for UI kind")
2015-06-11 03:06:58 +00:00
Kp
ee50d45e72
Pass window_send_event arg by &
2015-01-17 18:31:40 +00:00
Kp
fccb6814f8
Pass gr_create_sub_canvas arg by &
2015-01-17 18:31:40 +00:00
Kp
c2b7990550
Pass window_get_canvas arg by &
2015-01-17 18:31:40 +00:00
Kp
0bf2a6eb80
Return unique_ptr from ui_add_gadget_button
2014-12-20 04:36:10 +00:00
Kp
c43feee61d
Return unique_ptr from ui_add_gadget_listbox
2014-12-20 04:36:10 +00:00
Kp
1d363bbd5d
Return unique_ptr from ui_add_gadget_scrollbar
2014-12-20 04:36:10 +00:00
Kp
3b4fbd0bd5
Return unique_ptr from ui_add_gadget_radio
2014-12-20 04:36:10 +00:00
Kp
b16e8ecbec
Return unique_ptr from ui_add_gadget_checkbox
2014-12-20 04:36:09 +00:00
Kp
413a316154
Return unique_ptr from ui_add_gadget_inputbox
2014-12-20 04:36:09 +00:00
Kp
89b1ff8795
Return unique_ptr from ui_add_gadget_userbox
2014-12-20 04:36:09 +00:00
Kp
e1bb249176
Remove unused UI_GADGET_KEYTRAP
2014-12-20 04:36:09 +00:00
Kp
8d487b4883
Return unique_ptr from ui_add_gadget_icon
2014-12-20 04:36:09 +00:00
Kp
a8f853aa7a
Pass d_event arg by const&
2014-10-04 22:36:13 +00:00
Kp
8750b6a4ad
Switch d_event subclasses to C++ inheritance
2014-10-04 18:05:26 +00:00
Kp
ec4bb62a2c
Add break missed in C++ inheritance conversion
2014-09-08 00:08:17 +00:00
Kp
ff31905181
Use unique_ptr for grs_subcanvas
2014-09-07 19:04:06 +00:00
Kp
8321b90a9a
Use C++ inheritance for UI gadgets
2014-09-07 19:04:06 +00:00
Kp
f9e9f0faa9
Use RAIIdmem for gadgets
2014-08-27 03:15:06 +00:00
Kp
4acbb40ad7
Use enum for window event result
2014-08-07 02:47:48 +00:00
zico
ad7cb106bc
Changed custom D1X license to GPLv3
2014-06-01 19:55:23 +02:00
Kp
073f00974a
Eliminate uses of the typedef struct X { ... } X; pattern
...
C++ does not require this pattern.
import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
m = to.match(line)
if m:
osn = m.group(1)
print 'struct %s\n{' % osn
continue
if osn:
m = tc.match(line)
if m:
csn = m.group(2)
if osn == csn:
print '}%s;' % m.group(1)
osn = None
continue
else:
osn = None
print line,
2013-12-28 22:48:07 +00:00
Kp
2714679284
Mark private functions static
2013-11-02 04:23:55 +00:00
Kp
a6b1bd58a2
Use MALLOC consistently
2013-10-26 03:50:27 +00:00
Kp
a881ee455e
Remove fix.h
2013-08-08 03:01:48 +00:00
Kp
d66063497b
Move common/ui/gadget.c -> common/ui/gadget.cpp
2013-08-04 17:58:55 +00:00