X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;ds=sidebyside;f=gtk%2Fgtkpagesetup.c;h=40c3bdeeb69b98f68b12c75704886e4b5647b7d6;hb=3a86af43fa208786b5c848c09f9c8e1d3f060931;hp=a69e0821c56890522e510b74fed6bccaeb7717ac;hpb=5f1b5d24067468fc86b28dccc504c71abdaf68b8;p=~andy%2Fgtk diff --git a/gtk/gtkpagesetup.c b/gtk/gtkpagesetup.c index a69e0821c..40c3bdeeb 100644 --- a/gtk/gtkpagesetup.c +++ b/gtk/gtkpagesetup.c @@ -13,9 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -26,6 +24,58 @@ #include "gtkintl.h" #include "gtktypebuiltins.h" +/** + * SECTION:gtkpagesetup + * @Short_description: Stores page setup information + * @Title: GtkPageSetup + * + * A GtkPageSetup object stores the page size, orientation and margins. + * The idea is that you can get one of these from the page setup dialog + * and then pass it to the #GtkPrintOperation when printing. + * The benefit of splitting this out of the #GtkPrintSettings is that + * these affect the actual layout of the page, and thus need to be set + * long before user prints. + * + * + * The margins specified in this object are the "print margins", i.e. the + * parts of the page that the printer cannot print on. These are different + * from the layout margins that a word processor uses; they are typically + * used to determine the minimal size for the layout + * margins. + * + * + * To obtain a #GtkPageSetup use gtk_page_setup_new() to get the defaults, + * or use gtk_print_run_page_setup_dialog() to show the page setup dialog + * and receive the resulting page setup. + * + * + * A page setup dialog + * + * static GtkPrintSettings *settings = NULL; + * static GtkPageSetup *page_setup = NULL; + * + * static void + * do_page_setup (void) + * { + * GtkPageSetup *new_page_setup; + * + * if (settings == NULL) + * settings = gtk_print_settings_new (); + * + * new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window), + * page_setup, settings); + * + * if (page_setup) + * g_object_unref (page_setup); + * + * page_setup = new_page_setup; + * } + * + * + * + * Printing support was added in GTK+ 2.10. + */ + #define KEYFILE_GROUP_NAME "Page Setup" typedef struct _GtkPageSetupClass GtkPageSetupClass; @@ -98,10 +148,10 @@ gtk_page_setup_new (void) /** * gtk_page_setup_copy: * @other: the #GtkPageSetup to copy - * + * * Copies a #GtkPageSetup. - * - * Return value: a copy of @other + * + * Return value: (transfer full): a copy of @other * * Since: 2.10 */ @@ -474,7 +524,7 @@ gtk_page_setup_get_page_height (GtkPageSetup *setup, /** * gtk_page_setup_load_file: * @setup: a #GtkPageSetup - * @file_name: the filename to read the page setup from + * @file_name: (type filename): the filename to read the page setup from * @error: (allow-none): return location for an error, or %NULL * * Reads the page setup from the file @file_name. @@ -508,7 +558,7 @@ gtk_page_setup_load_file (GtkPageSetup *setup, /** * gtk_page_setup_new_from_file: - * @file_name: the filename to read the page setup from + * @file_name: (type filename): the filename to read the page setup from * @error: (allow-none): return location for an error, or %NULL * * Reads the page setup from the file @file_name. Returns a @@ -678,7 +728,7 @@ gtk_page_setup_new_from_key_file (GKeyFile *key_file, /** * gtk_page_setup_to_file: * @setup: a #GtkPageSetup - * @file_name: the file to save to + * @file_name: (type filename): the file to save to * @error: (allow-none): return location for errors, or %NULL * * This function saves the information from @setup to @file_name.