summaryrefslogtreecommitdiff
path: root/cad/lepton-eda/files
diff options
context:
space:
mode:
Diffstat (limited to 'cad/lepton-eda/files')
-rw-r--r--cad/lepton-eda/files/patch-build-tools_icon-theme-installer20
-rw-r--r--cad/lepton-eda/files/patch-cli_Makefile.am11
-rw-r--r--cad/lepton-eda/files/patch-docs_scheme-api_Makefile.am14
-rw-r--r--cad/lepton-eda/files/patch-liblepton_include_liblepton_geda__list.h23
-rw-r--r--cad/lepton-eda/files/patch-liblepton_scheme_geda_log-rotate.scm11
-rw-r--r--cad/lepton-eda/files/patch-liblepton_scheme_geda_os.scm10
-rw-r--r--cad/lepton-eda/files/patch-liblepton_src_Makefile.am11
-rw-r--r--cad/lepton-eda/files/patch-liblepton_src_geda__list.c36
-rw-r--r--cad/lepton-eda/files/patch-liblepton_src_scheme__os.c43
-rw-r--r--cad/lepton-eda/files/patch-m4_geda-guile.m426
-rw-r--r--cad/lepton-eda/files/patch-netlist_scheme_backend_gnet-spice-sdb.scm11
-rw-r--r--cad/lepton-eda/files/patch-schematic_scheme_gschem_action.scm102
-rw-r--r--cad/lepton-eda/files/patch-schematic_src_Makefile.am11
-rw-r--r--cad/lepton-eda/files/patch-schematic_src_x__tabs.c275
-rw-r--r--cad/lepton-eda/files/patch-utils_gschlas_Makefile.am11
-rw-r--r--cad/lepton-eda/files/patch-version.h8
16 files changed, 447 insertions, 176 deletions
diff --git a/cad/lepton-eda/files/patch-build-tools_icon-theme-installer b/cad/lepton-eda/files/patch-build-tools_icon-theme-installer
new file mode 100644
index 000000000000..db7baf233ded
--- /dev/null
+++ b/cad/lepton-eda/files/patch-build-tools_icon-theme-installer
@@ -0,0 +1,20 @@
+--- build-tools/icon-theme-installer.orig 2019-10-03 20:45:55 UTC
++++ build-tools/icon-theme-installer
+@@ -103,13 +103,13 @@ if test -z "$INSTALL_BASE_DIR"; then
+ exit 1
+ fi
+
+-if test ! -x `echo "$MKINSTALLDIRS_EXEC" | cut -f1 -d' '`; then
+- echo "Cannot find '$MKINSTALLDIRS_EXEC'; You probably want to pass -m \$(mkinstalldirs)"
++if test -z "$MKINSTALLDIRS_EXEC"; then
++ echo "\$MKINSTALLDIRS_EXEC is not set. Pass it with the -m command line option"
+ exit 1
+ fi
+
+-if test ! -x `echo "$INSTALL_DATA_EXEC" | cut -f1 -d' '`; then
+- echo "Cannot find '$INSTALL_DATA_EXEC'; You probably want to pass -x \$(INSTALL_DATA)"
++if test -z "$INSTALL_DATA_EXEC"; then
++ echo "\$INSTALL_DATA_EXEC' is not set. Pass it with the -x command line option"
+ exit 1
+ fi
+
diff --git a/cad/lepton-eda/files/patch-cli_Makefile.am b/cad/lepton-eda/files/patch-cli_Makefile.am
deleted file mode 100644
index 25cecbc2d7f1..000000000000
--- a/cad/lepton-eda/files/patch-cli_Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
---- cli/Makefile.am.orig 2019-07-19 17:10:25 UTC
-+++ cli/Makefile.am
-@@ -28,7 +28,7 @@ lepton_cli_CPPFLAGS = \
- lepton_cli_CFLAGS = \
- $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GUILE_CFLAGS) $(GTK_CFLAGS) \
- $(GDK_PIXBUF_CFLAGS) $(CAIRO_CFLAGS) $(CAIRO_PNG_CFLAGS) \
-- $(CAIRO_PDF_CLAGS) $(CAIRO_PS_CFLAGS) $(CAIRO_SVG_CFLAGS)
-+ $(CAIRO_PDF_CLAGS) $(CAIRO_PS_CFLAGS) $(CAIRO_SVG_CFLAGS) $(CFLAGS)
- lepton_cli_LDFLAGS = $(GUILE_LIBS) $(GTK_LIBS) $(GDK_PIXBUF_LIBS) $(CAIRO_LIBS) \
- $(CAIRO_PNG_LIBS) $(CAIRO_PDF_CLAGS) $(CAIRO_PS_LIBS) $(CAIRO_SVG_LIBS)
- lepton_cli_LDADD = \
diff --git a/cad/lepton-eda/files/patch-docs_scheme-api_Makefile.am b/cad/lepton-eda/files/patch-docs_scheme-api_Makefile.am
new file mode 100644
index 000000000000..4e69271a1197
--- /dev/null
+++ b/cad/lepton-eda/files/patch-docs_scheme-api_Makefile.am
@@ -0,0 +1,14 @@
+--- docs/scheme-api/Makefile.am.orig 2019-10-09 16:39:51 UTC
++++ docs/scheme-api/Makefile.am
+@@ -4,10 +4,8 @@ AM_MAKEINFOHTMLFLAGS = --css-ref=lepton-
+
+ EXTRA_DIST = lepton-scheme.css
+
+-html-local:
++all: all-am html
+ $(MKDIR_P) $(builddir)/lepton-scheme.html/
+ cp -fv $(srcdir)/lepton-scheme.css $(builddir)/lepton-scheme.html/
+
+-all-local: html
+-
+ install-data-local: install-html
diff --git a/cad/lepton-eda/files/patch-liblepton_include_liblepton_geda__list.h b/cad/lepton-eda/files/patch-liblepton_include_liblepton_geda__list.h
new file mode 100644
index 000000000000..11c607841489
--- /dev/null
+++ b/cad/lepton-eda/files/patch-liblepton_include_liblepton_geda__list.h
@@ -0,0 +1,23 @@
+--- liblepton/include/liblepton/geda_list.h.orig 2019-10-03 20:45:55 UTC
++++ liblepton/include/liblepton/geda_list.h
+@@ -1,7 +1,8 @@
+-/* gEDA - GPL Electronic Design Automation
+- * libgeda - gEDA's library
++/* Lepton EDA library
+ * Copyright (C) 1998-2010 Ales Hvezda
+ * Copyright (C) 2007-2010 Peter Clifton
++ * Copyright (C) 2011-2015 gEDA Contributors
++ * Copyright (C) 2017-2019 Lepton EDA Contributors
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+@@ -56,6 +57,9 @@ void geda_list_add_glist( GedaList *list
+ void geda_list_remove( GedaList *list, gpointer item );
+ /*void geda_list_remove_glist( GedaList *list, GList *items ); */ /* Undemanded as yet */
+ void geda_list_remove_all( GedaList *list );
++void geda_list_move_item( GedaList* list, gpointer item, gint newpos );
++
++
+
+ /*const GList *geda_list_get_glist( GedaList *list ); */
+ #define geda_list_get_glist(list) (list->glist)
diff --git a/cad/lepton-eda/files/patch-liblepton_scheme_geda_log-rotate.scm b/cad/lepton-eda/files/patch-liblepton_scheme_geda_log-rotate.scm
new file mode 100644
index 000000000000..ed6df94ab5c2
--- /dev/null
+++ b/cad/lepton-eda/files/patch-liblepton_scheme_geda_log-rotate.scm
@@ -0,0 +1,11 @@
+--- liblepton/scheme/geda/log-rotate.scm.orig 2019-10-03 20:45:55 UTC
++++ liblepton/scheme/geda/log-rotate.scm
+@@ -44,7 +44,7 @@
+ ;; FIXME This should be obtained from the code that decides where to
+ ;; create and populate log files.
+ (define (log-directory)
+- (string-append (user-config-dir) file-name-separator-string "logs"))
++ (string-append (user-cache-dir) file-name-separator-string "logs"))
+
+ ;;;; get-log-toolname path
+ ;;
diff --git a/cad/lepton-eda/files/patch-liblepton_scheme_geda_os.scm b/cad/lepton-eda/files/patch-liblepton_scheme_geda_os.scm
new file mode 100644
index 000000000000..3ee77bd43111
--- /dev/null
+++ b/cad/lepton-eda/files/patch-liblepton_scheme_geda_os.scm
@@ -0,0 +1,10 @@
+--- liblepton/scheme/geda/os.scm.orig 2019-10-03 20:45:55 UTC
++++ liblepton/scheme/geda/os.scm
+@@ -49,6 +49,7 @@
+ (define-public sys-config-dirs %sys-config-dirs)
+ (define-public user-data-dir %user-data-dir)
+ (define-public user-config-dir %user-config-dir)
++(define-public user-cache-dir %user-cache-dir)
+
+ (define-public expand-env-variables
+ ;; Only compile regular expression once
diff --git a/cad/lepton-eda/files/patch-liblepton_src_Makefile.am b/cad/lepton-eda/files/patch-liblepton_src_Makefile.am
deleted file mode 100644
index d6d0e6628d86..000000000000
--- a/cad/lepton-eda/files/patch-liblepton_src_Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
---- liblepton/src/Makefile.am.orig 2019-07-19 16:53:37 UTC
-+++ liblepton/src/Makefile.am
-@@ -99,7 +99,7 @@ liblepton_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
- -I$(srcdir)/../include -I$(srcdir)/../include/liblepton -I$(top_srcdir)
- liblepton_la_CFLAGS = \
- $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GUILE_CFLAGS) $(GLIB_CFLAGS) \
-- $(GDK_PIXBUF_CFLAGS)
-+ $(GDK_PIXBUF_CFLAGS) $(CFLAGS)
- liblepton_la_LDFLAGS = -version-info $(LIBLEPTON_SHLIB_VERSION) \
- $(WINDOWS_LIBTOOL_FLAGS) $(MINGW_LDFLAGS) $(GUILE_LIBS) \
- $(GLIB_LIBS) $(GDK_PIXBUF_LIBS)
diff --git a/cad/lepton-eda/files/patch-liblepton_src_geda__list.c b/cad/lepton-eda/files/patch-liblepton_src_geda__list.c
new file mode 100644
index 000000000000..491b287aba79
--- /dev/null
+++ b/cad/lepton-eda/files/patch-liblepton_src_geda__list.c
@@ -0,0 +1,36 @@
+--- liblepton/src/geda_list.c.orig 2019-10-03 20:45:55 UTC
++++ liblepton/src/geda_list.c
+@@ -1,7 +1,8 @@
+-/* gEDA - GPL Electronic Design Automation
+- * libgeda - gEDA's library
++/* Lepton EDA library
+ * Copyright (C) 1998-2000 Ales Hvezda
+ * Copyright (C) 2007-2010 Peter Clifton
++ * Copyright (C) 2011-2013 gEDA Contributors
++ * Copyright (C) 2017-2019 Lepton EDA Contributors
+ *
+ * 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
+@@ -179,3 +180,22 @@ void geda_list_remove_all( GedaList *lis
+ g_signal_emit( list, geda_list_signals[ CHANGED ], 0 );
+ }
+
++
++/*! \brief Moves the list data \a item to a new position \a newpos.
++ */
++void geda_list_move_item( GedaList* list, gpointer item, gint newpos )
++{
++ GList* gl = list->glist;
++ GList* node = g_list_find (gl, item);
++
++ if (node != NULL)
++ {
++ gl = g_list_remove_link (gl, node);
++ gl = g_list_insert (gl, item, newpos);
++ g_list_free (node);
++ list->glist = gl;
++
++ g_signal_emit( list, geda_list_signals[ CHANGED ], 0 );
++ }
++}
++
diff --git a/cad/lepton-eda/files/patch-liblepton_src_scheme__os.c b/cad/lepton-eda/files/patch-liblepton_src_scheme__os.c
new file mode 100644
index 000000000000..573336f6ea30
--- /dev/null
+++ b/cad/lepton-eda/files/patch-liblepton_src_scheme__os.c
@@ -0,0 +1,43 @@
+--- liblepton/src/scheme_os.c.orig 2019-10-03 20:45:55 UTC
++++ liblepton/src/scheme_os.c
+@@ -153,6 +153,25 @@ SCM_DEFINE (user_config_dir, "%user-conf
+ return scm_from_locale_string(eda_get_user_config_dir());
+ }
+
++/*! \brief Get user cache directory.
++ * \par Function Description
++ * Returns the directory where per-user cache data should be
++ * stored
++ *
++ * \note Scheme API: Implements the %user-cache-dir procedure is the
++ * (geda core os) module.
++ *
++ * \return a string.
++ */
++SCM_DEFINE (user_cache_dir, "%user-cache-dir", 0, 0, 0, (),
++ "Return the directory for user cache data.")
++{
++ /* eda_get_user_cache_dir() returns a raw environment string, so assume
++ * it's in the current locale's encoding. */
++ return scm_from_locale_string (eda_get_user_cache_dir ());
++}
++
++
+ /*!
+ * \brief Create the (geda core os) Scheme module.
+ * \par Function Description
+@@ -166,8 +185,12 @@ init_module_geda_core_os (void *unused)
+ #include "scheme_os.x"
+
+ /* Add them to the module's public definitions. */
+- scm_c_export (s_platform, s_sys_data_dirs, s_sys_config_dirs,
+- s_user_data_dir, s_user_config_dir,
++ scm_c_export (s_platform,
++ s_sys_config_dirs,
++ s_sys_data_dirs,
++ s_user_cache_dir,
++ s_user_config_dir,
++ s_user_data_dir,
+ NULL);
+ }
+
diff --git a/cad/lepton-eda/files/patch-m4_geda-guile.m4 b/cad/lepton-eda/files/patch-m4_geda-guile.m4
deleted file mode 100644
index 0cb53f7adbad..000000000000
--- a/cad/lepton-eda/files/patch-m4_geda-guile.m4
+++ /dev/null
@@ -1,26 +0,0 @@
---- m4/geda-guile.m4.orig 2018-12-11 19:24:41 UTC
-+++ m4/geda-guile.m4
-@@ -34,9 +34,20 @@ AC_DEFUN([AX_CHECK_GUILE],
- GUILE_MIN_MINOR=`echo ${GUILE_MIN_VER} | sed -e 's;[[^\.]]*\.;;' -e 's;\..*;;g'`
- GUILE_MIN_TEENY=`echo ${GUILE_MIN_VER} | sed -e 's;.*\.;;'`
-
-- PKG_CHECK_MODULES(GUILE, [guile-2.0 >= $GUILE_MIN_VER],
-- [GUILE_PKG_NAME=guile-2.0],
-- [AC_MSG_ERROR([you need at least version ${GUILE_MIN_VER} of guile])])
-+ _found_pkg_config_guile=yes
-+ PKG_CHECK_MODULES(GUILE, [guile-2.2 >= $GUILE_MIN_VER],
-+ [GUILE_PKG_NAME=guile-2.2], [_found_pkg_config_guile=no])
-+
-+ if test "${_found_pkg_config_guile}" = "no" ; then
-+ PKG_CHECK_MODULES(GUILE, [guile-2.0 >= $GUILE_MIN_VER],
-+ [_found_pkg_config_guile=yes
-+ GUILE_PKG_NAME=guile-2.0],
-+ [_found_pkg_config_guile=no])
-+ fi
-+
-+ if test "${_found_pkg_config_guile}" = "no" ; then
-+ AC_MSG_ERROR([you need at least version ${GUILE_MIN_VER} of guile])
-+ fi
-
- AC_SUBST([GUILE_PKG_NAME])
-
diff --git a/cad/lepton-eda/files/patch-netlist_scheme_backend_gnet-spice-sdb.scm b/cad/lepton-eda/files/patch-netlist_scheme_backend_gnet-spice-sdb.scm
new file mode 100644
index 000000000000..6cdbc8c5394d
--- /dev/null
+++ b/cad/lepton-eda/files/patch-netlist_scheme_backend_gnet-spice-sdb.scm
@@ -0,0 +1,11 @@
+--- netlist/scheme/backend/gnet-spice-sdb.scm.orig 2019-10-03 20:45:55 UTC
++++ netlist/scheme/backend/gnet-spice-sdb.scm
+@@ -209,7 +209,7 @@
+ (and (string-ci=? (gnetlist:get-package-attribute package "device")
+ "spice-io")
+ package))
+- (filter-map spice-io? ls))
++ (filter-map spice-io? package-list))
+
+
+ ;;; Given a list of spice-IO packages (refdeses), this function
diff --git a/cad/lepton-eda/files/patch-schematic_scheme_gschem_action.scm b/cad/lepton-eda/files/patch-schematic_scheme_gschem_action.scm
deleted file mode 100644
index b20f0508c377..000000000000
--- a/cad/lepton-eda/files/patch-schematic_scheme_gschem_action.scm
+++ /dev/null
@@ -1,102 +0,0 @@
---- schematic/scheme/gschem/action.scm.orig 2018-12-11 19:24:41 UTC
-+++ schematic/scheme/gschem/action.scm
-@@ -1,6 +1,7 @@
- ;; Lepton EDA Schematic Capture
- ;; Scheme API
- ;; Copyright (C) 2013 Peter Brett <peter@peter-b.co.uk>
-+;; Copyright (C) 2017-2019 Lepton EDA Contributors
- ;;
- ;; 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
-@@ -21,11 +22,10 @@
- #:use-module (gschem core gettext)
- #:use-module (gschem window)
- #:use-module (gschem hook)
-+ #:use-module (geda log)
- #:use-module (ice-9 optargs)
- #:export-syntax (define-action))
-
--(or (defined? 'define-syntax)
-- (use-modules (ice-9 syncase)))
-
- (define last-action (make-fluid))
- (define current-action-position (make-fluid))
-@@ -33,18 +33,25 @@
- ;; Define an eval-in-currentmodule procedure
- (define (eval-cm expr) (eval expr (current-module)))
-
--;; Evaluates a gschem action. A gschem action is expected to be a
-+;; Evaluates a lepton-schematic action. An action is expected to be a
- ;; symbol naming a thunk variable in the current module.
- ;;
- ;; The special-case symbol repeat-last-command causes the last action
- ;; executed to be repeated.
- (define-public (eval-action! action)
- (define (invalid-action-error)
-- (error (_ "~S is not a valid gschem action.") action))
-+ (log! 'warning (_ "[~A] is not a valid lepton-schematic action.") action))
-+ (define (no-last-action-error)
-+ (log! 'message (_ "There is no last action to repeat.")))
-
- (define (eval-action!/recursive a)
-
- (cond
-+ ;; The action is #f when the user hits "." (repeat last action)
-+ ;; and there is no last action to repeat.
-+ ((eq? a #f)
-+ (no-last-action-error))
-+
- ;; Handle repeat-last-command
- ((equal? 'repeat-last-command a)
- ;; N.b. must call eval-action! rather than
-@@ -107,29 +114,30 @@
- ;; The action is a magical procedure that does nothing but call
- ;; eval-action! *on itself*. This allows you to invoke an action
- ;; just by calling it like a normal function.
-- (letrec ((action (lambda () (eval-action! action))))
-+ (let ((unique-tag (list #f)))
-+ (letrec ((action (case-lambda
-+ (() (eval-action! action))
-+ ((x) unique-tag))))
-
-- ;; The action data is stored in procedure properties -- most
-- ;; importantly, the actual thunk that the action wraps
-- (let ((sp! (lambda (k v) (set-procedure-property! action k v))))
-- (sp! 'gschem-cookie %cookie)
-- (sp! 'gschem-thunk thunk)
-- (sp! 'gschem-properties '()))
-+ ;; The action data is stored in procedure properties -- most
-+ ;; importantly, the actual thunk that the action wraps
-+ (let ((sp! (lambda (k v) (set-procedure-property! action k v))))
-+ (sp! 'gschem-cookie %cookie)
-+ (sp! 'gschem-thunk thunk)
-+ (sp! 'gschem-properties '()))
-
-- ;; Deal with any properties. props should contain arguments in
-- ;; pairs, where the first element of each pair is a keyword naming
-- ;; a procedure property (e.g. #:icon) and the second element in
-- ;; the corresponding value (e.g. "insert-text").
-- (let loop ((lst props))
-- (and (< 1 (length lst))
-- (set-action-property! action
-- (keyword->symbol (list-ref lst 0))
-- (list-ref lst 1))
-- (loop (list-tail lst 2))))
--
--
-+ ;; Deal with any properties. props should contain arguments in
-+ ;; pairs, where the first element of each pair is a keyword naming
-+ ;; a procedure property (e.g. #:icon) and the second element in
-+ ;; the corresponding value (e.g. "insert-text").
-+ (let loop ((lst props))
-+ (and (< 1 (length lst))
-+ (set-action-property! action
-+ (keyword->symbol (list-ref lst 0))
-+ (list-ref lst 1))
-+ (loop (list-tail lst 2))))
-
-- action))
-+ action)))
-
- (define (action-thunk action)
- (procedure-property action 'gschem-thunk))
diff --git a/cad/lepton-eda/files/patch-schematic_src_Makefile.am b/cad/lepton-eda/files/patch-schematic_src_Makefile.am
deleted file mode 100644
index ad548580c976..000000000000
--- a/cad/lepton-eda/files/patch-schematic_src_Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
---- schematic/src/Makefile.am.orig 2019-07-19 17:20:29 UTC
-+++ schematic/src/Makefile.am
-@@ -128,7 +128,7 @@ lepton_schematic_CPPFLAGS = -I$(top_srcdir)/liblepton/
- -I$(top_srcdir) -I$(includedir)
- lepton_schematic_CFLAGS = $(GCC_CFLAGS) $(LIBSTROKE_CFLAGS) \
- $(MINGW_CFLAGS) \
-- $(GLIB_CFLAGS) $(GTK_CFLAGS) $(GTHREAD_CFLAGS) $(GUILE_CFLAGS)
-+ $(GLIB_CFLAGS) $(GTK_CFLAGS) $(GTHREAD_CFLAGS) $(GUILE_CFLAGS) $(CFLAGS)
- lepton_schematic_LDFLAGS = $(LIBSTROKE_LDFLAGS) $(GLIB_LIBS) $(GTK_LIBS) \
- $(GTHREAD_LIBS) $(GUILE_LIBS) $(MINGW_GUI_LDFLAGS)
- lepton_schematic_LDADD = \
diff --git a/cad/lepton-eda/files/patch-schematic_src_x__tabs.c b/cad/lepton-eda/files/patch-schematic_src_x__tabs.c
new file mode 100644
index 000000000000..f6adf5192818
--- /dev/null
+++ b/cad/lepton-eda/files/patch-schematic_src_x__tabs.c
@@ -0,0 +1,275 @@
+--- schematic/src/x_tabs.c.orig 2019-10-03 20:45:55 UTC
++++ schematic/src/x_tabs.c
+@@ -53,7 +53,7 @@
+ * key: use-tabs
+ * group: schematic.gui
+ * type: boolean
+- * default val: false
++ * default val: true
+ *
+ * 2) Whether to show "close" button on tabs:
+ * key: show-close-button
+@@ -75,7 +75,7 @@
+
+
+ static gboolean
+-g_x_tabs_enabled = FALSE;
++g_x_tabs_enabled = TRUE;
+
+ static gboolean
+ g_x_tabs_show_close_button = TRUE;
+@@ -284,6 +284,28 @@ x_tabs_page_on_sel (GtkNotebook* nbook,
+ guint ndx,
+ gpointer data);
+
++static void
++x_tabs_page_on_reordered (GtkNotebook* nbook,
++ GtkWidget* wtab,
++ guint newindex,
++ gpointer data);
++
++
++static gboolean
++x_tabs_hdr_on_mouse_click (GtkWidget* hdr, GdkEvent* e, gpointer data);
++static GtkMenu*
++x_tabs_menu_create (TabInfo* nfo);
++static void
++x_tabs_menu_create_item (GschemToplevel* toplevel,
++ GtkWidget* menu,
++ const gchar* action_name,
++ const gchar* action_label,
++ const gchar* icon_name);
++static void
++x_tabs_menu_create_item_separ (GtkWidget* menu);
++static void
++x_tabs_menu_item_on_activate (GtkAction* action, gpointer data);
++
+
+
+ /* page view: */
+@@ -409,7 +431,24 @@ x_tabs_dbg_pages_dump (GschemToplevel* w
+ printf( " ^^^^^^^^^^^^^^ pages ^^^^^^^^^^^^^^^^^^\n\n" );
+ }
+
+-#endif
++static void
++x_tabs_dbg_pages_dump_simple (GschemToplevel* w_current)
++{
++ printf( " >> pages:\n" );
++ g_return_if_fail( w_current != NULL );
++
++ for ( GList* node = w_current->toplevel->pages->glist;
++ node != NULL;
++ node = g_list_next( node ) )
++ {
++ PAGE* p = node->data;
++ printf( " p: [%s]\n", g_path_get_basename( s_page_get_filename(p) ) );
++ }
++
++ printf( "\n" );
++}
++
++#endif /* DEBUG */
+
+
+
+@@ -661,6 +700,11 @@ x_tabs_nbook_create (GschemToplevel* w_c
+ g_signal_connect (nbook, "switch-page",
+ G_CALLBACK (&x_tabs_page_on_sel), w_current);
+
++ g_signal_connect (nbook,
++ "page-reordered",
++ G_CALLBACK (&x_tabs_page_on_reordered),
++ w_current);
++
+ } /* x_tabs_nbook_create() */
+
+
+@@ -913,7 +957,18 @@ x_tabs_hdr_set (GtkNotebook* nbook, TabI
+ g_return_if_fail (nfo != NULL);
+
+ GtkWidget* hdr = x_tabs_hdr_create (nfo);
+- gtk_notebook_set_tab_label (nbook, nfo->wtab_, hdr);
++
++ GtkWidget* ebox = gtk_event_box_new();
++ gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE);
++ gtk_container_add (GTK_CONTAINER (ebox), hdr);
++ gtk_widget_show_all (ebox);
++
++ g_signal_connect (ebox,
++ "button-press-event",
++ G_CALLBACK (&x_tabs_hdr_on_mouse_click),
++ nfo);
++
++ gtk_notebook_set_tab_label (nbook, nfo->wtab_, ebox);
+ }
+
+
+@@ -1160,6 +1215,8 @@ x_tabs_page_new (GschemToplevel* w_curre
+ x_tabs_tl_pview_cur_set (w_current, pview);
+ gint ndx = x_tabs_nbook_page_add (w_current, page, pview, wtab);
+
++ gtk_notebook_set_tab_reorderable (w_current->xtabs_nbook, wtab, TRUE);
++
+ return x_tabs_info_add (w_current, ndx, page, pview, wtab);
+
+ } /* x_tabs_page_new() */
+@@ -1485,3 +1542,158 @@ x_tabs_page_on_sel (GtkNotebook* nbook,
+
+ } /* x_tabs_page_on_sel() */
+
++
++
++/*! \brief GtkNotebook "page-reordered" signal handler.
++ */
++static void
++x_tabs_page_on_reordered (GtkNotebook* nbook,
++ GtkWidget* wtab,
++ guint newindex,
++ gpointer data)
++{
++ GschemToplevel* w_current = (GschemToplevel*) data;
++ g_return_if_fail (w_current != NULL);
++ g_return_if_fail (w_current->toplevel != NULL);
++ g_return_if_fail (w_current->toplevel->pages != NULL);
++
++ TabInfo* nfo = x_tabs_info_find_by_wtab (w_current->xtabs_info_list, wtab);
++ g_return_if_fail (nfo != NULL);
++
++ GedaPageList* pages = w_current->toplevel->pages;
++ geda_list_move_item (pages, nfo->page_, newindex);
++
++ gtk_widget_grab_focus (GTK_WIDGET (nfo->pview_));
++ page_select_widget_update (w_current);
++
++#ifdef DEBUG
++ x_tabs_dbg_pages_dump_simple( w_current );
++#endif
++
++} /* x_tabs_page_on_reordered() */
++
++
++
++/*! \brief Create popup menu for tab's header.
++ */
++static GtkMenu*
++x_tabs_menu_create (TabInfo* nfo)
++{
++ g_return_val_if_fail (nfo != NULL, NULL);
++
++ GschemToplevel* tl = nfo->tl_;
++ g_return_val_if_fail (tl != NULL, NULL);
++
++ GtkWidget* menu = gtk_menu_new();
++ x_tabs_menu_create_item (tl, menu, "file-new", _("_New"), GTK_STOCK_NEW);
++ x_tabs_menu_create_item (tl, menu, "file-open", _("_Open"), GTK_STOCK_OPEN);
++ x_tabs_menu_create_item_separ (menu);
++ x_tabs_menu_create_item (tl, menu, "file-save", _("_Save"), GTK_STOCK_SAVE);
++ x_tabs_menu_create_item (tl, menu, "file-save-as", _("Save _As..."), GTK_STOCK_SAVE_AS);
++ x_tabs_menu_create_item_separ (menu);
++ x_tabs_menu_create_item (tl, menu, "page-manager", _("Page _Manager..."), NULL);
++ x_tabs_menu_create_item_separ (menu);
++ x_tabs_menu_create_item (tl, menu, "page-close", _("_Close"), GTK_STOCK_CLOSE);
++
++ gtk_widget_show_all (menu);
++ return GTK_MENU (menu);
++
++} /* x_tabs_menu_create() */
++
++
++
++/*! \brief Tab's header widget "button-press-event" signal handler.
++ * \todo Consider switching to clicked tab
++ */
++static gboolean
++x_tabs_hdr_on_mouse_click (GtkWidget* hdr, GdkEvent* e, gpointer data)
++{
++ g_return_val_if_fail (data != NULL, FALSE);
++ GdkEventButton* ebtn = (GdkEventButton*) e;
++
++ TabInfo* nfo = (TabInfo*) data;
++ TabInfo* nfocur = x_tabs_info_cur (nfo->tl_);
++
++ /* show menu for current tab only:
++ */
++ if (nfo != nfocur)
++ return FALSE;
++
++#ifdef DEBUG
++ printf( "p: [%s]\n", g_path_get_basename( s_page_get_filename(nfo->page_) ) );
++ printf( "C: [%s]\n\n", g_path_get_basename( s_page_get_filename(nfocur->page_) ) );
++#endif
++
++ if (ebtn->type == GDK_BUTTON_PRESS && ebtn->button == 3)
++ {
++ GtkMenu* menu = x_tabs_menu_create (nfo);
++
++ int btn = 0;
++ int etime = 0;
++ if (ebtn != NULL)
++ {
++ btn = ebtn->button;
++ etime = gtk_get_current_event_time();
++ }
++
++ gtk_menu_attach_to_widget (menu, hdr, NULL);
++ gtk_menu_popup (menu, NULL, NULL, NULL, NULL, btn, etime);
++
++ return TRUE;
++ }
++
++ return FALSE;
++
++} /* x_tabs_page_on_mouse_click() */
++
++
++
++/*! \brief "activate" signal handler for context menu item action.
++ */
++static void
++x_tabs_menu_item_on_activate (GtkAction* action, gpointer data)
++{
++ GschemToplevel* toplevel = (GschemToplevel*) data;
++ const gchar* action_name = gtk_action_get_name (action);
++
++ g_action_eval_by_name (toplevel, action_name);
++}
++
++
++
++/*! \brief Create and add popup menu item separator.
++ */
++static void
++x_tabs_menu_create_item_separ (GtkWidget* menu)
++{
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu),
++ gtk_separator_menu_item_new());
++}
++
++
++
++/*! \brief Create and add popup menu item.
++ */
++static void
++x_tabs_menu_create_item (GschemToplevel* toplevel,
++ GtkWidget* menu,
++ const gchar* action_name,
++ const gchar* action_label,
++ const gchar* icon_name)
++{
++ GschemAction* action = gschem_action_new (action_name, /* name */
++ action_label, /* label */
++ NULL, /* tooltip */
++ icon_name, /* stock_id */
++ NULL); /* multikey_accel */
++
++ GtkWidget* item = gtk_action_create_menu_item (GTK_ACTION (action));
++ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
++
++ g_signal_connect (action,
++ "activate",
++ G_CALLBACK (&x_tabs_menu_item_on_activate),
++ toplevel);
++
++} /* x_tabs_menu_create_item() */
++
diff --git a/cad/lepton-eda/files/patch-utils_gschlas_Makefile.am b/cad/lepton-eda/files/patch-utils_gschlas_Makefile.am
deleted file mode 100644
index 6b82a8f1e0ad..000000000000
--- a/cad/lepton-eda/files/patch-utils_gschlas_Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
---- utils/gschlas/Makefile.am.orig 2018-12-11 19:24:41 UTC
-+++ utils/gschlas/Makefile.am
-@@ -16,7 +16,7 @@ lepton_schlas_CPPFLAGS = -I$(top_srcdir)
- -I$(top_srcdir) -I$(includedir)
- lepton_schlas_CFLAGS = $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GLIB_CFLAGS) \
- $(GUILE_CFLAGS) $(GDK_PIXBUF_CFLAGS)
--lepton_schlas_LDFLAGS = $(GLIB_LIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS)
-+lepton_schlas_LDFLAGS = $(GLIB_LIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS) $(GIO_LIBS)
- lepton_schlas_LDADD = $(top_builddir)/liblepton/src/liblepton.la
-
- MOSTLYCLEANFILES = *.log *.ps core FILE *~
diff --git a/cad/lepton-eda/files/patch-version.h b/cad/lepton-eda/files/patch-version.h
index 5b7112cca60a..e76426b2fa30 100644
--- a/cad/lepton-eda/files/patch-version.h
+++ b/cad/lepton-eda/files/patch-version.h
@@ -1,11 +1,11 @@
---- version.h.orig 2018-12-13 02:49:55 UTC
+--- version.h.orig 2019-10-04 15:45:44 UTC
+++ version.h
@@ -0,0 +1,8 @@
+/* Date part of package version string. */
-+#define PACKAGE_DATE_VERSION "20181211"
++#define PACKAGE_DATE_VERSION "20191003"
+
+/* Dotted part of package version string. */
-+#define PACKAGE_DOTTED_VERSION "1.9.7"
++#define PACKAGE_DOTTED_VERSION "1.9.9"
+
+/* Current git commit. */
-+#define PACKAGE_GIT_COMMIT "f3a8714fdfd6dae491ebfff69f0fd9aa4899f9a6"
++#define PACKAGE_GIT_COMMIT "3139e7782564ff4bf76963984a735fbe638e43a0"