Browse code
chore: moving
Ed Langley authored on 29/10/2020 23:34:03
Showing 3 changed files
Showing 3 changed files
... | ... |
@@ -683,7 +683,12 @@ |
683 | 683 |
</items> |
684 | 684 |
<point key="canvasLocation" x="117" y="-135"/> |
685 | 685 |
</menu> |
686 |
- <window title="demo-app" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g"> |
|
686 |
+ <window title="demo-app" |
|
687 |
+ allowsToolTipsWhenApplicationIsInactive="NO" |
|
688 |
+ autorecalculatesKeyViewLoop="NO" |
|
689 |
+ releasedWhenClosed="NO" |
|
690 |
+ animationBehavior="default" |
|
691 |
+ id="QvC-M9-y7g"> |
|
687 | 692 |
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> |
688 | 693 |
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> |
689 | 694 |
<rect key="contentRect" x="335" y="390" width="130" height="127"/> |
... | ... |
@@ -11,20 +11,20 @@ demo-app: dylib |
11 | 11 |
demo-app.iconset: demo-app.svg |
12 | 12 |
rm -rf demo-app.iconset |
13 | 13 |
mkdir -p demo-app.iconset |
14 |
- rsvg-convert -w 16 -h 16 demo-app.svg > demo-app.iconset/icon_16x16.png |
|
15 |
- rsvg-convert -w 32 -h 32 demo-app.svg > demo-app.iconset/icon_16x16@2x.png |
|
16 |
- rsvg-convert -w 32 -h 32 demo-app.svg > demo-app.iconset/icon_32x32.png |
|
17 |
- rsvg-convert -w 64 -h 64 demo-app.svg > demo-app.iconset/icon_32x32@2x.png |
|
18 |
- rsvg-convert -w 64 -h 64 demo-app.svg > demo-app.iconset/icon_64x64.png |
|
19 |
- rsvg-convert -w 128 -h 128 demo-app.svg > demo-app.iconset/icon_64x64@2x.png |
|
20 |
- rsvg-convert -w 128 -h 128 demo-app.svg > demo-app.iconset/icon_128x128.png |
|
21 |
- rsvg-convert -w 256 -h 256 demo-app.svg > demo-app.iconset/icon_128x128@2x.png |
|
22 |
- rsvg-convert -w 256 -h 256 demo-app.svg > demo-app.iconset/icon_256x256.png |
|
23 |
- rsvg-convert -w 512 -h 512 demo-app.svg > demo-app.iconset/icon_256x256@2x.png |
|
24 |
- rsvg-convert -w 512 -h 512 demo-app.svg > demo-app.iconset/icon_512x512.png |
|
25 |
- rsvg-convert -w 1024 -h 1024 demo-app.svg > demo-app.iconset/icon_512x512@2x.png |
|
26 |
- rsvg-convert -w 1024 -h 1024 demo-app.svg > demo-app.iconset/icon_1024x1024.png |
|
27 |
- rsvg-convert -w 2048 -h 2048 demo-app.svg > demo-app.iconset/icon_1024x1024@2x.png |
|
14 |
+ zsh convert.sh demo-app.svg 16 demo-app.iconset/icon_16x16.png |
|
15 |
+ zsh convert.sh demo-app.svg 32 demo-app.iconset/icon_16x16@2x.png |
|
16 |
+ zsh convert.sh demo-app.svg 32 demo-app.iconset/icon_32x32.png |
|
17 |
+ zsh convert.sh demo-app.svg 64 demo-app.iconset/icon_32x32@2x.png |
|
18 |
+ zsh convert.sh demo-app.svg 64 demo-app.iconset/icon_64x64.png |
|
19 |
+ zsh convert.sh demo-app.svg 128 demo-app.iconset/icon_64x64@2x.png |
|
20 |
+ zsh convert.sh demo-app.svg 128 demo-app.iconset/icon_128x128.png |
|
21 |
+ zsh convert.sh demo-app.svg 256 demo-app.iconset/icon_128x128@2x.png |
|
22 |
+ zsh convert.sh demo-app.svg 256 demo-app.iconset/icon_256x256.png |
|
23 |
+ zsh convert.sh demo-app.svg 512 demo-app.iconset/icon_256x256@2x.png |
|
24 |
+ zsh convert.sh demo-app.svg 512 demo-app.iconset/icon_512x512.png |
|
25 |
+ zsh convert.sh demo-app.svg 1024 demo-app.iconset/icon_512x512@2x.png |
|
26 |
+ zsh convert.sh demo-app.svg 1024 demo-app.iconset/icon_1024x1024.png |
|
27 |
+ zsh convert.sh demo-app.svg 2048 demo-app.iconset/icon_1024x1024@2x.png |
|
28 | 28 |
|
29 | 29 |
mkapp: dylib demo-app demo-app.iconset |
30 | 30 |
rm -rf demo.app |
... | ... |
@@ -219,6 +219,7 @@ |
219 | 219 |
(cls objc-runtime::o-class) |
220 | 220 |
(sel objc-runtime::o-selector) |
221 | 221 |
(value :pointer)) |
222 |
+ |
|
222 | 223 |
(defun set-string-value (control string) |
223 | 224 |
(prog1 control |
224 | 225 |
(%set-string-value control @(setStringValue:) |
... | ... |
@@ -259,7 +260,9 @@ |
259 | 260 |
|
260 | 261 |
(defun task-thread () |
261 | 262 |
(bt:make-thread (lambda () |
263 |
+ #+(or) |
|
262 | 264 |
(trivial-main-thread:with-body-in-main-thread (:blocking t) |
265 |
+ [#@NSEvent @(stopPeriodicEvents)] |
|
263 | 266 |
[#@NSEvent @(startPeriodicEventsAfterDelay:withPeriod:) :double 0.0d0 :double 0.01d0]) |
264 | 267 |
(loop |
265 | 268 |
(trivial-main-thread:with-body-in-main-thread (:blocking t) |
... | ... |
@@ -268,16 +271,6 @@ |
268 | 271 |
|
269 | 272 |
;;#+nil |
270 | 273 |
(defun old-main () |
271 |
- (load "~/quicklisp/setup.lisp") |
|
272 |
- (funcall (intern "QUICKLOAD" |
|
273 |
- (find-package :QL)) |
|
274 |
- :swank) |
|
275 |
- #+nil |
|
276 |
- (funcall (intern "CREATE-SERVER" |
|
277 |
- (find-package :swank)) |
|
278 |
- :port 5060 |
|
279 |
- :dont-close t) |
|
280 |
- |
|
281 | 274 |
(trivial-main-thread:with-body-in-main-thread (:blocking nil) |
282 | 275 |
#+sbcl |
283 | 276 |
(sb-int:set-floating-point-modes :traps '()) |
... | ... |
@@ -317,3 +310,58 @@ |
317 | 310 |
[the-window @(makeKeyAndOrderFront:) :pointer (cffi:null-pointer)] |
318 | 311 |
[ objc-runtime::ns-app @(activateIgnoringOtherApps:) :boolean t] |
319 | 312 |
(task-thread)))))) |
313 |
+ |
|
314 |
+(cffi:defcfun (%get-view-frame "objc_msgSend_stret") |
|
315 |
+ :void |
|
316 |
+ (out (:pointer (:struct objc-runtime:ns-rect))) |
|
317 |
+ (class :pointer) |
|
318 |
+ (sel :pointer)) |
|
319 |
+ |
|
320 |
+(cffi:defcfun (%init-with-frame "objc_msgSend") |
|
321 |
+ :pointer |
|
322 |
+ (class :pointer) |
|
323 |
+ (sel :pointer) |
|
324 |
+ (frame (:struct objc-runtime:ns-rect))) |
|
325 |
+ |
|
326 |
+(defmacro new-msg-send (selector ((&rest arg-types) return-type)) |
|
327 |
+ (let ((arg-syms (mapcar (lambda (_) (gensym (symbol-name _))) |
|
328 |
+ arg-types))) |
|
329 |
+ `(lambda ,(cons 'target arg-syms) |
|
330 |
+ (cffi:foreign-funcall "objc_msgSend" |
|
331 |
+ :pointer target |
|
332 |
+ :pointer ,selector |
|
333 |
+ ,@(mapcan #'list arg-types arg-syms) |
|
334 |
+ ,return-type)))) |
|
335 |
+ |
|
336 |
+(defmacro make-view-dictionary (&rest objc-values) |
|
337 |
+ (alexandria:with-gensyms (selector) |
|
338 |
+ `(let ((,selector (new-msg-send @(dictionaryWithObjectsAndKeys:) |
|
339 |
+ ((,@(mapcar (lambda (_) _ :pointer) objc-values) :pointer) |
|
340 |
+ :pointer)))) |
|
341 |
+ (funcall ,selector ,@objc-values (cffi:null-pointer))))) |
|
342 |
+ |
|
343 |
+#+(or) |
|
344 |
+(defun text-view (parent-view) |
|
345 |
+ (let ((text-view [#@NSTextView @(alloc)])) |
|
346 |
+ |
|
347 |
+ |
|
348 |
+ |
|
349 |
+ |
|
350 |
+ |
|
351 |
+ (trivial-main-thread:with-body-in-main-thread (:blocking nil) |
|
352 |
+ (cffi:with-foreign-pointer (v (cffi:foreign-type-size '(:struct objc-runtime::ns-rect))) |
|
353 |
+ (%get-view-frame v *window-view* @(frame)) |
|
354 |
+ (init-with-frame *text-view* v)) |
|
355 |
+ [*window-view* @(addSubview:) :pointer *text-view*]?) |
|
356 |
+ |
|
357 |
+ (defparameter *view-dictionary* |
|
358 |
+ ) |
|
359 |
+ )) |
|
360 |
+ |
|
361 |
+#+(or) |
|
362 |
+(progn |
|
363 |
+ (defparameter *window-view* |
|
364 |
+ [(main-view *application-shim*) @(superview)]) |
|
365 |
+ (trivial-main-thread:with-body-in-main-thread (:blocking nil) |
|
366 |
+ [(main-view *application-shim*) @(removeFromSuperview)]? |
|
367 |
+ )) |