From db25b0c9caebf7dfc80d2e6cb35bb1c41f973082 Mon Sep 17 00:00:00 2001 From: John Darrington
Date: Wed, 4 Jan 2012 16:06:36 +0100 Subject: [PATCH] Added a new infrastructure to autogenerate screenshots of dialog boxes --- src/ui/gui/automake.mk | 60 ++++++++++++++++--- src/ui/gui/dark.rc | 16 +++++ src/ui/gui/default.rc | 8 +++ src/ui/gui/dialog-capture.c | 130 +++++++++++++++++++++++++++++++++++++++++ src/ui/gui/gen-screenshots.sh | 88 +++++++++++++++++++++++++++ src/ui/gui/high-contrast.rc | 19 ++++++ 6 files changed, 312 insertions(+), 9 deletions(-) create mode 100644 src/ui/gui/dark.rc create mode 100644 src/ui/gui/default.rc create mode 100644 src/ui/gui/dialog-capture.c create mode 100644 src/ui/gui/gen-screenshots.sh create mode 100644 src/ui/gui/high-contrast.rc diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index c007a83..9dce7ed 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -48,22 +48,39 @@ EXTRA_DIST += \ src/ui/gui/pspp.desktop if HAVE_GUI -bin_PROGRAMS += src/ui/gui/psppire +bin_PROGRAMS += src/ui/gui/psppire \ + src/ui/gui/dialog-capture -src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) $(GTKSOURCEVIEW_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 +src_ui_gui_dialog_capture_SOURCES = $(gui_sources) \ + src/ui/gui/dialog-capture.c -src_ui_gui_psppire_LDFLAGS = \ +nodist_src_ui_gui_dialog_capture_SOURCES = $(nodist_gui_sources) + +src_ui_gui_dialog_capture_CFLAGS = $(GTK_CFLAGS) $(GTKSOURCEVIEW_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 + +src_ui_gui_dialog_capture_LDADD = \ + src/ui/gui/sheet/libsheet.la \ + lib/gtk-contrib/libgtksheet.a \ + src/ui/libuicommon.la \ + src/libpspp.la \ + src/libpspp-core.la \ + $(GTK_LIBS) \ + $(GTKSOURCEVIEW_LIBS) \ + $(CAIRO_LIBS) \ + $(LIBINTL) + +src_ui_gui_dialog_capture_LDFLAGS = \ $(PSPPIRE_LDFLAGS) \ $(PG_LDFLAGS) - if RELOCATABLE_VIA_LD -src_ui_gui_psppire_LDFLAGS += `$(RELOCATABLE_LDFLAGS) $(bindir)` +src_ui_gui_dialog_capture_LDFLAGS += `$(RELOCATABLE_LDFLAGS) $(bindir)` else -src_ui_gui_psppire_LDFLAGS += -rpath $(pkglibdir) +src_ui_gui_dialog_capture_LDFLAGS += -rpath $(pkglibdir) endif +src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) $(GTKSOURCEVIEW_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 src_ui_gui_psppire_LDADD = \ src/ui/gui/sheet/libsheet.la \ @@ -76,6 +93,20 @@ src_ui_gui_psppire_LDADD = \ $(CAIRO_LIBS) \ $(LIBINTL) + +src_ui_gui_psppire_LDFLAGS = \ + $(PSPPIRE_LDFLAGS) \ + $(PG_LDFLAGS) + + +if RELOCATABLE_VIA_LD +src_ui_gui_psppire_LDFLAGS += `$(RELOCATABLE_LDFLAGS) $(bindir)` +else +src_ui_gui_psppire_LDFLAGS += -rpath $(pkglibdir) +endif + + + src_ui_gui_psppiredir = $(pkgdatadir) @@ -127,7 +158,7 @@ dist_src_ui_gui_psppire_DATA = \ $(top_srcdir)/src/ui/gui/icons/splash.png -src_ui_gui_psppire_SOURCES = \ +gui_sources = \ src/ui/gui/psppire-dialog.c \ src/ui/gui/psppire-keypad.c \ src/ui/gui/psppire-selector.c \ @@ -191,7 +222,6 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/k-means-dialog.h \ src/ui/gui/ks-one-sample-dialog.c \ src/ui/gui/ks-one-sample-dialog.h \ - src/ui/gui/main.c \ src/ui/gui/missing-val-dialog.c \ src/ui/gui/missing-val-dialog.h \ src/ui/gui/oneway-anova-dialog.c \ @@ -292,10 +322,18 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/widgets.c \ src/ui/gui/widgets.h -nodist_src_ui_gui_psppire_SOURCES = \ +nodist_gui_sources = \ src/ui/gui/psppire-marshal.c \ src/ui/gui/psppire-marshal.h + +nodist_src_ui_gui_psppire_SOURCES = $(nodist_gui_sources) + +src_ui_gui_psppire_SOURCES = $(gui_sources) \ + src/ui/gui/main.c + + + yelp-check: @if ! yelp --version > /dev/null 2>&1 ; then \ echo ; \ @@ -345,3 +383,7 @@ src/ui/gui/include/gtk/gtk.h: src/ui/gui/include/gtk/gtk.in.h mv address@hidden $@ CLEANFILES += src/ui/gui/include/gtk/gtk.h EXTRA_DIST += src/ui/gui/include/gtk/gtk.in.h + +.PHONY: screenshots +screenshots: + $(SHELL) $(top_srcdir)/src/ui/gui/gen-screenshots.sh $(top_srcdir) \ No newline at end of file diff --git a/src/ui/gui/dark.rc b/src/ui/gui/dark.rc new file mode 100644 index 0000000..16b9188 --- /dev/null +++ b/src/ui/gui/dark.rc @@ -0,0 +1,16 @@ +style "Dark" +{ + font_name = "Sans Italic 10" + base[NORMAL] = "#343434" + base[INSENSITIVE] = mix (0.7, "#343434", "#d3d3d3") + text[NORMAL] = "#d3d3d3" + bg[NORMAL] = "#555555" + bg[INSENSITIVE] = mix (0.7, "#555555", "#e3e3e3") + fg[NORMAL] = "#e3e3e3" + + engine "clearlooks" {} +} + + +class "*" style "Dark" + diff --git a/src/ui/gui/default.rc b/src/ui/gui/default.rc new file mode 100644 index 0000000..791c5f0 --- /dev/null +++ b/src/ui/gui/default.rc @@ -0,0 +1,8 @@ + +style "default" +{ +} + + +class "*" style "default" + diff --git a/src/ui/gui/dialog-capture.c b/src/ui/gui/dialog-capture.c new file mode 100644 index 0000000..580f2e3 --- /dev/null +++ b/src/ui/gui/dialog-capture.c @@ -0,0 +1,130 @@ +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2012 Free Software Foundation + + 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 + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see