modular smoke kde.core.
Sat Apr 3 19:20:37 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* modular smoke kde.core.
diff -rN -u old-kde.core/TODO new-kde.core/TODO
--- old-kde.core/TODO 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/TODO 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-* fix segfault on exit after kde:application has run
diff -rN -u old-kde.core/cl-smoke.kde.core.asd new-kde.core/cl-smoke.kde.core.asd
--- old-kde.core/cl-smoke.kde.core.asd 1970-01-01 01:00:00.000000000 +0100
+++ new-kde.core/cl-smoke.kde.core.asd 2014-10-30 06:56:26.000000000 +0100
@@ -0,0 +1,12 @@
+(defsystem :cl-smoke.kde.core
+ :name :kde.core
+ :version (0 0 1)
+ :author "Tobias Rautenkranz"
+ :license "GPL with linking exception"
+ :description "Smoke KDE core bindings."
+ :depends-on (:cl-smoke.qt.core :cl-smoke.qt.network :cl-smoke.qt.dbus :cl-smoke.smoke)
+ :components
+ ((:module "src" :components
+ ((:file "package")
+ (:file "dr-konqi" :depends-on ("package"))
+ (:file "kde" :depends-on ("package" "dr-konqi"))))))
diff -rN -u old-kde.core/kde.mbd new-kde.core/kde.mbd
--- old-kde.core/kde.mbd 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/kde.mbd 1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
-;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
-
-(in-package :sysdef-user)
-
-(define-system :kde ()
- (:version 0 0 1)
- (:documentation "Smoke KDE bindings.")
- (:keywords "GUI" "KDE")
- (:author "Tobias Rautenkranz")
- (:license "GPL with linking exception")
- (:needs :qt)
-; (:uses-macros-from :smoke)
- (:components
- ("src" module
- (:components
- "package"
- ("dr-konqi" (:needs "package"))
- ("kde" (:needs "package" "dr-konqi"))
- ("application" (:needs "package" "kde"))
- ("standard-action" (:needs "package" "kde"))))))
diff -rN -u old-kde.core/src/application.lisp new-kde.core/src/application.lisp
--- old-kde.core/src/application.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/src/application.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1,67 +0,0 @@
-(in-package :kde)
-
-(declaim (optimize (debug 3)))
-
-;;; FIXME crash on quit, Called from ~KIconLoader():
-;;; CL-USER> (cffi:defcfun (kbacktrace "_Z14kRealBacktracei") :pointer
-;;; (levels :int))
-;;; KBACKTRACE
-;;; CL-USER> (kbacktrace -1)
-;;;
-;;; Unhandled memory fault at #x0.
-
-(defun app ()
- (assert (app-p))
- (qt:app))
-
-(defun app-p ()
- (and (qt:app-p)
- (typep (qt:app) (find-class 'application))))
-
-(defun make-aboutdata (app-name program-name version)
- (let ((app-name (make-instance 'qt:byte-array :args (list app-name)))
- (catalog-name (make-instance 'qt:byte-array))
- (program-name (kde:ki18n program-name))
- (version (make-instance 'qt:byte-array :args (list version))))
- (make-instance 'about-data :args (list app-name catalog-name
- program-name version))))
-
-(let ((argv))
- (defun ensure-app (about-data &optional (application 'application)
- (args #+sbcl sb-ext:*posix-argv*
- #-sbcl (list "lisp")))
- (if (qt:app-p)
- (progn
- (assert (typep (qt:app) (find-class application))
- ()
- "The existing application object ~A is
-not of type ~A." (qt:app) (find-class application))
- (values (qt:app) nil))
- (let ((args (append (list (first args))
- '("--nocrashhandler") (rest args))))
- (unless (null argv)
- (foreign-free argv)
- (setf argv (null-pointer)))
-
- (setf argv (foreign-alloc :string :initial-contents args))
- (kde:cmd-line-args.init (length args) argv about-data)
- (values (make-instance 'application) t))))
- (defun kill-app ()
- (qt:application.close-all-windows)
- (setf cl-smoke.qt-impl::*widgets* nil)
- ;; FIXME make it work without mem-faults
- (trivial-garbage:cancel-finalization (app))
- (cxx:delete-later (app))
- ;(smoke::delete-pointer (smoke::pointer (app)) (class-of (app)))
- (setf (slot-value (app) 'pointer) (null-pointer))))
-
-(defmacro with-app (about-data &body body)
- `(cl-smoke.qt-impl::with-application ((ensure-app ,about-data)
- (kill-app))
- ,@body))
-
-(defmacro with-kde ((app-name program-name version) &body body)
- (let ((about-data (gensym)))
- `(let ((,about-data (make-aboutdata ,app-name ,program-name ,version)))
- (with-app ,about-data
- ,@body))))
diff -rN -u old-kde.core/src/dr-konqi.lisp new-kde.core/src/dr-konqi.lisp
--- old-kde.core/src/dr-konqi.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/src/dr-konqi.lisp 2014-10-30 06:56:26.000000000 +0100
@@ -1,4 +1,4 @@
-(in-package :kde)
+(in-package :cl-smoke.kde.core)
(defun disable-dr-konqi ()
"Disables the Dr Konqi crash manager since it traps signals."
diff -rN -u old-kde.core/src/kde.lisp new-kde.core/src/kde.lisp
--- old-kde.core/src/kde.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/src/kde.lisp 2014-10-30 06:56:26.000000000 +0100
@@ -1,4 +1,4 @@
-;;; Copyright (C) 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
+;;; Copyright (C) 2009, 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
;;;
;;; This program is free software: you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
@@ -25,11 +25,11 @@
;;; do so. If you do not wish to do so, delete this exception statement
;;; from your version.
-(in-package :kde)
+(in-package :cl-smoke.kde.core)
-(smoke:define-smoke-module :kde libsmokekde
- (*kde-smoke* "kde_Smoke")
- (init-kde-smoke "init_kde_Smoke"))
+(smoke:define-smoke-module :kde libsmokekdecore
+ (*kdecore-smoke* "kdecore_Smoke")
+ (init-kdecore-smoke "init_kdecore_Smoke"))
-(eval-when (:load-toplevel :compile-toplevel :execute)
+(smoke::eval-startup ()
(disable-dr-konqi))
diff -rN -u old-kde.core/src/package.lisp new-kde.core/src/package.lisp
--- old-kde.core/src/package.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/src/package.lisp 2014-10-30 06:56:26.000000000 +0100
@@ -1,7 +1,13 @@
-(defpackage :kde
+(defpackage :cl-smoke.kde.core
(:use :cl :smoke :cffi :cxx-support)
+ (:nicknames :kde.core))
+
+(defpackage :cl-smoke.kde
+ (:use)
(:export #:make-aboutdata
- #:make-standard-action
- #:init-app
- #:with-kde
- #:with-app))
+ #:make-standard-action
+ #:app
+ #:app-p
+ #:with-kde
+ #:with-app)
+ (:nicknames :kde))
diff -rN -u old-kde.core/src/standard-action.lisp new-kde.core/src/standard-action.lisp
--- old-kde.core/src/standard-action.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/src/standard-action.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-(in-package :kde)
-
-(defun make-standard-action (action action-collection &optional slot)
- "Adds the standard-action ACTION to ACTION-COLLECTION and connects
-the \"triggered()\" signal to SLOT when specified."
- (let ((std-action (standard-action.create action
- (null-pointer)
- (null-pointer)
- action-collection)))
- (when slot
- (qt:connect (qt:get-signal std-action "triggered()")
- slot))
- std-action))
diff -rN -u old-kde.core/test.lisp new-kde.core/test.lisp
--- old-kde.core/test.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/test.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1,31 +0,0 @@
-#|
-cmake ./ && make || exit 1
-# LD_PRELOAD causes utf8 decoding errors in sbcl
-# in run-progam used by sysdef.cmake
-sbcl --noinform --noprint --disable-debugger --load $0 --end-toplevel-options -c || exit 1
-LD_PRELOAD=./util/libcl-smoke-disable-backtrace.so exec -a "$0" sbcl --noinform --noprint --disable-debugger --load $0 --end-toplevel-options
-# do not use --script to allow loading mudballs with ${HOME}/.sbclrc
-# Used for testing on darcs record.
-|#
-
-(in-package :sysdef-user)
-
-(defun load-sysdef (pathname system)
- (load pathname)
- (setf (mb.sysdef::pathname-of (find-system system)) pathname))
-
-(defun load-sysdef-file (system-name)
- "Loads a mbd file in the current directory."
- (load-sysdef (make-pathname :defaults *default-pathname-defaults*
- :name (string-downcase system-name)
- :type "mbd")
- system-name))
-
-(load-sysdef-file :kde)
-(when (= 2 (length sb-ext:*posix-argv*))
- (mb:load :kde)
- (sb-ext:quit))
-
-(mb:test :kde)
-
-(sb-ext:quit)
diff -rN -u old-kde.core/tests/test.lisp new-kde.core/tests/test.lisp
--- old-kde.core/tests/test.lisp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/tests/test.lisp 1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-(mb:test :kde.tests)
diff -rN -u old-kde.core/util/CMakeLists.txt new-kde.core/util/CMakeLists.txt
--- old-kde.core/util/CMakeLists.txt 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/util/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
@@ -1,15 +0,0 @@
-find_package(Qt4)
-set(QT_DONT_USE_QTGUI true)
-include(${QT_USE_FILE})
-
-include(CheckCXXCompilerFlag)
-check_cxx_compiler_flag("-fvisibility=hidden" CXX_VISIBILITY)
-if(CXX_VISIBILITY)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
-endif(CXX_VISIBILITY)
-
-add_library(cl-smoke-disable-backtrace SHARED backtrace.cpp)
-target_link_libraries(cl-smoke-disable-backtrace ${QT_LIBRARIES})
-
-#install(TARGETS cl-smoke-disable-backtrace
-# LIBRARY DESTINATION lib)
diff -rN -u old-kde.core/util/backtrace.cpp new-kde.core/util/backtrace.cpp
--- old-kde.core/util/backtrace.cpp 2014-10-30 06:56:26.000000000 +0100
+++ new-kde.core/util/backtrace.cpp 1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +0,0 @@
-#include <QDebug>
-
-#define BT_EXPORT __attribute__((visibility("default")))
-
-extern "C" {
-/** Overwrites backtrace_symbols in execinfo.h and does nothing.
- * Work around segfault in:
- * ~KIconLoader()
- * kRealBacktrace(int)
- * backtrace_symbols
- *
- * ~KIconLoader() is called at exit when an KApplication has been constructed.
- * Somehow a negative number is pased as size to backtrace_symbols:
- * void* trace[256];
- * backtrace_symbols(trace, -1219315128); // => SIGSEGV
- * and segfaults in sysdeps/generic/elf/backtracesyms.c:65
- */
-BT_EXPORT char**
-backtrace_symbols(void* const* buffer, int size)
-{
- qDebug() << "libcl-smoke-disable-backtrace: backtrace_symbols workaround\n"
- << "\tbuffer: " << buffer << "size: " << size;
- return NULL;
-}
-
-// overwriting backtrace(void** buffer, int size) does not work!?
-}