Skip to content

Instantly share code, notes, and snippets.

View jmercouris's full-sized avatar
🌴

John Mercouris jmercouris

🌴
View GitHub Profile
(defun call-user-function ()
(get-minibuffer-input "what's your age?" some-user-function))
(defun some-user-function (input-1)
)
(defun get-minibuffer-input (prompt function)
(register-user-function function)
(defparameter *some-global* ())
(defun my-command ()
(with-results ((name (read-from-minibuffer :prompt "What is your name?"))
(age (read-from-minibuffer :prompt "What is your age?")))
(print name)
(print age)
(setf *some-global* name))
(print *some-global*))
(defun copy ()
(#/sendAction:to:from: ccl::*nsapp* (objc:@selector #/copy:) nil *next-view*))
(defun paste ()
(#/sendAction:to:from: ccl::*nsapp* (objc:@selector #/paste:) nil *next-view*))
(defun cut ()
(#/sendAction:to:from: ccl::*nsapp* (objc:@selector #/cut:) nil *next-view*))
(in-package :next)
(setf *start-page-url* "about:blank")
(defvar *shell-mode-map* (make-hash-table :test 'equalp))
(defclass shell-mode (mode) ())
(defun shell-mode ()
(make-instance 'application-mode
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; next.asd
(defsystem :next
:serial t
:depends-on (:cl-strings :cl-string-match :puri :queues.simple-queue
:sqlite :parenscript :cl-json :swank
(:require "cocoa") (:require "webkit"))
:pathname "source/"
:components ((:file "package")
(defmethod print-object ((buffer buffer) stream)
(format stream "~s" (name buffer)))
The value
#<FUNCTION (LAMBDA () :IN INTERFACE:WEB-VIEW-EXECUTE)
{1008EE579B}>
is not of type
SYSTEM-AREA-POINTER.
[Condition of type TYPE-ERROR]
Restarts:
0: [RETURN-FROM-G-CLOSURE] Return value from closure
1: [ABORT] abort thread (#<THREAD "cl-cffi-gtk main thread" RUNNING {1003FF4C53}>)
;;; callback.lisp --- C-side callbacks
;; This file is part of cl-webkit.
;;
;; cl-webkit is free software; you can redistribute it and/or modify
;; it under the terms of the MIT license.
;; See `COPYING' in the source distribution for details.
;;; Code:
(cffi:defcallback callybacky :void ()
(print "called!"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(cffi:defcallback callybacky :void ()
(print "called!"))
(defun web-view-execute (view script)
(let ((np (cffi:null-pointer)))
(webkit2:webkit-web-view-run-javascript view script np callybacky np)))