Sat Apr 3 19:29:08 CEST 2010 Tobias Rautenkranz * modular Smoke kdeui diff -rN -u old-kde.ui/CMakeLists.txt new-kde.ui/CMakeLists.txt --- old-kde.ui/CMakeLists.txt 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project(cl-smoke.kde) - -add_subdirectory(util) diff -rN -u old-kde.ui/TODO new-kde.ui/TODO --- old-kde.ui/TODO 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/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.ui/cl-smoke.kde.ui.asd new-kde.ui/cl-smoke.kde.ui.asd --- old-kde.ui/cl-smoke.kde.ui.asd 1970-01-01 01:00:00.000000000 +0100 +++ new-kde.ui/cl-smoke.kde.ui.asd 2014-10-30 07:22:04.000000000 +0100 @@ -0,0 +1,13 @@ +(defsystem :cl-smoke.kde.ui + :name :kde.ui + :version (0 0 1) + :author "Tobias Rautenkranz" + :license "GPL with linking exception" + :description "Smoke KDE ui bindings." + :depends-on (:cl-smoke.kde.core :cl-smoke.qt.svg) + :components + ((:module "src" :components + ((:file "package") + (:file "kde" :depends-on ("package")) + (:file "application" :depends-on ("kde")) + (:file "standard-action" :depends-on ("kde")))))) diff -rN -u old-kde.ui/kde.mbd new-kde.ui/kde.mbd --- old-kde.ui/kde.mbd 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/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.ui/src/application.lisp new-kde.ui/src/application.lisp --- old-kde.ui/src/application.lisp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/src/application.lisp 2014-10-30 07:22:04.000000000 +0100 @@ -1,38 +1,28 @@ -(in-package :kde) +(in-package :cl-smoke.kde.ui) -(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)) +(defun kde:app () + (assert (kde:app-p)) (qt:app)) -(defun app-p () +(defun kde:app-p () (and (qt:app-p) - (typep (qt:app) (find-class 'application)))) + (typep (qt:app) (find-class 'kde:application)))) -(defun make-aboutdata (app-name program-name version) +(defun kde: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)))) + (make-instance 'kde:about-data :args (list app-name catalog-name + program-name version)))) (let ((argv)) - (defun ensure-app (about-data &optional (application 'application) + (defun ensure-app (about-data &optional (application 'kde:application) (args #+sbcl sb-ext:*posix-argv* #-sbcl (list "lisp"))) (if (qt:app-p) (progn - (assert (typep (qt:app) (find-class application)) + (assert (typep (qt:app) (find-class 'kde:application)) () "The existing application object ~A is not of type ~A." (qt:app) (find-class application)) @@ -45,23 +35,23 @@ (setf argv (foreign-alloc :string :initial-contents args)) (kde:cmd-line-args.init (length args) argv about-data) - (values (make-instance 'application) t)))) + (values (make-instance 'kde:application) t)))) (defun kill-app () (qt:application.close-all-windows) - (setf cl-smoke.qt-impl::*widgets* nil) + (setf cl-smoke.qt.gui::*widgets* nil) ;; FIXME make it work without mem-faults - (trivial-garbage:cancel-finalization (app)) - (cxx:delete-later (app)) + (trivial-garbage:cancel-finalization (kde:app)) + (cxx:delete-later (kde:app)) ;(smoke::delete-pointer (smoke::pointer (app)) (class-of (app))) - (setf (slot-value (app) 'pointer) (null-pointer)))) + (setf (slot-value (kde:app) 'pointer) (null-pointer)))) -(defmacro with-app (about-data &body body) - `(cl-smoke.qt-impl::with-application ((ensure-app ,about-data) +(defmacro kde:with-app (about-data &body body) + `(cl-smoke.qt.core::with-application ((ensure-app ,about-data) (kill-app)) ,@body)) -(defmacro with-kde ((app-name program-name version) &body body) +(defmacro kde: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)))) + `(let ((,about-data (kde:make-aboutdata ,app-name ,program-name ,version))) + (kde:with-app ,about-data + ,@body)))) diff -rN -u old-kde.ui/src/dr-konqi.lisp new-kde.ui/src/dr-konqi.lisp --- old-kde.ui/src/dr-konqi.lisp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/src/dr-konqi.lisp 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -(in-package :kde) - -(defun disable-dr-konqi () - "Disables the Dr Konqi crash manager since it traps signals." - #+sbcl (sb-posix:putenv "KDE_DEBUG=true") - #-sbcl (warn "Can not disable Dr. Konqi.")) diff -rN -u old-kde.ui/src/kde.lisp new-kde.ui/src/kde.lisp --- old-kde.ui/src/kde.lisp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/src/kde.lisp 2014-10-30 07:22:04.000000000 +0100 @@ -1,4 +1,4 @@ -;;; Copyright (C) 2009 Tobias Rautenkranz +;;; Copyright (C) 2009, 2010 Tobias Rautenkranz ;;; ;;; 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,8 @@ ;;; 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.ui) -(smoke:define-smoke-module :kde libsmokekde - (*kde-smoke* "kde_Smoke") - (init-kde-smoke "init_kde_Smoke")) - -(eval-when (:load-toplevel :compile-toplevel :execute) - (disable-dr-konqi)) +(smoke:define-smoke-module :kde libsmokekdeui + (*kdeui-smoke* "kdeui_Smoke") + (init-kdeui-smoke "init_kdeui_Smoke")) diff -rN -u old-kde.ui/src/package.lisp new-kde.ui/src/package.lisp --- old-kde.ui/src/package.lisp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/src/package.lisp 2014-10-30 07:22:04.000000000 +0100 @@ -1,7 +1,3 @@ -(defpackage :kde +(defpackage :cl-smoke.kde.ui (:use :cl :smoke :cffi :cxx-support) - (:export #:make-aboutdata - #:make-standard-action - #:init-app - #:with-kde - #:with-app)) + (:nicknames :kde.ui)) diff -rN -u old-kde.ui/src/standard-action.lisp new-kde.ui/src/standard-action.lisp --- old-kde.ui/src/standard-action.lisp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/src/standard-action.lisp 2014-10-30 07:22:04.000000000 +0100 @@ -1,12 +1,12 @@ -(in-package :kde) +(in-package :cl-smoke.kde.ui) -(defun make-standard-action (action action-collection &optional slot) +(defun kde: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))) + (let ((std-action (kde:standard-action.create action + (null-pointer) + (null-pointer) + action-collection))) (when slot (qt:connect (qt:get-signal std-action "triggered()") slot)) diff -rN -u old-kde.ui/tests/test.lisp new-kde.ui/tests/test.lisp --- old-kde.ui/tests/test.lisp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/tests/test.lisp 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -(mb:test :kde.tests) diff -rN -u old-kde.ui/util/CMakeLists.txt new-kde.ui/util/CMakeLists.txt --- old-kde.ui/util/CMakeLists.txt 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/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.ui/util/backtrace.cpp new-kde.ui/util/backtrace.cpp --- old-kde.ui/util/backtrace.cpp 2014-10-30 07:22:04.000000000 +0100 +++ new-kde.ui/util/backtrace.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -#include - -#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!? -}