summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2016-01-15 20:06:45 +0100
committerJoakim Verona <joakim@verona.se>2016-01-15 20:06:45 +0100
commit4b73dac2885aa7eb23b66c299065e19bd118a4fb (patch)
tree18452b36b890faf52d40f555ebe4dc3c6e020bc6 /src/gtkutil.c
parent0d824cc5e79e7d29a01929a51dfd673a117c77e8 (diff)
parent984a14904658da42ca9dea50a811a901ddc56e60 (diff)
downloademacs-xwidget_mvp.tar.gz
merge masterxwidget_mvp
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 90683eba7b8..768df342983 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1,6 +1,6 @@
/* Functions for creating and updating GTK widgets.
-Copyright (C) 2003-2015 Free Software Foundation, Inc.
+Copyright (C) 2003-2016 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -4084,31 +4084,11 @@ xg_page_setup_dialog (void)
Lisp_Object
xg_get_page_setup (void)
{
- Lisp_Object result, orientation_symbol;
GtkPageOrientation orientation;
+ Lisp_Object orientation_symbol;
if (page_setup == NULL)
page_setup = gtk_page_setup_new ();
- result = list4 (Fcons (Qleft_margin,
- make_float (gtk_page_setup_get_left_margin (page_setup,
- GTK_UNIT_POINTS))),
- Fcons (Qright_margin,
- make_float (gtk_page_setup_get_right_margin (page_setup,
- GTK_UNIT_POINTS))),
- Fcons (Qtop_margin,
- make_float (gtk_page_setup_get_top_margin (page_setup,
- GTK_UNIT_POINTS))),
- Fcons (Qbottom_margin,
- make_float (gtk_page_setup_get_bottom_margin (page_setup,
- GTK_UNIT_POINTS))));
- result = Fcons (Fcons (Qheight,
- make_float (gtk_page_setup_get_page_height (page_setup,
- GTK_UNIT_POINTS))),
- result);
- result = Fcons (Fcons (Qwidth,
- make_float (gtk_page_setup_get_page_width (page_setup,
- GTK_UNIT_POINTS))),
- result);
orientation = gtk_page_setup_get_orientation (page_setup);
if (orientation == GTK_PAGE_ORIENTATION_PORTRAIT)
orientation_symbol = Qportrait;
@@ -4118,9 +4098,24 @@ xg_get_page_setup (void)
orientation_symbol = Qreverse_portrait;
else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE)
orientation_symbol = Qreverse_landscape;
- result = Fcons (Fcons (Qorientation, orientation_symbol), result);
- return result;
+ return listn (CONSTYPE_HEAP, 7,
+ Fcons (Qorientation, orientation_symbol),
+#define MAKE_FLOAT_PAGE_SETUP(f) make_float (f (page_setup, GTK_UNIT_POINTS))
+ Fcons (Qwidth,
+ MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_page_width)),
+ Fcons (Qheight,
+ MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_page_height)),
+ Fcons (Qleft_margin,
+ MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_left_margin)),
+ Fcons (Qright_margin,
+ MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_right_margin)),
+ Fcons (Qtop_margin,
+ MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_top_margin)),
+ Fcons (Qbottom_margin,
+ MAKE_FLOAT_PAGE_SETUP (gtk_page_setup_get_bottom_margin))
+#undef MAKE_FLOAT_PAGE_SETUP
+ );
}
static void