[19538] | 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
| 2 | /* This file is part of the GtkHTML library. |
---|
| 3 | |
---|
| 4 | Copyright (C) 2000 Helix Code, Inc. |
---|
| 5 | |
---|
| 6 | This library is free software; you can redistribute it and/or |
---|
| 7 | modify it under the terms of the GNU Library General Public |
---|
| 8 | License as published by the Free Software Foundation; either |
---|
| 9 | version 2 of the License, or (at your option) any later version. |
---|
| 10 | |
---|
| 11 | This library is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 14 | Library General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU Library General Public License |
---|
| 17 | along with this library; see the file COPYING.LIB. If not, write to |
---|
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
| 19 | Boston, MA 02111-1307, USA. |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #include <config.h> |
---|
| 23 | #include "htmlengine.h" |
---|
| 24 | #include "htmlimage.h" |
---|
| 25 | #include "htmlcluealigned.h" |
---|
| 26 | |
---|
| 27 | #include "htmlengine-edit-cut-and-paste.h" |
---|
| 28 | #include "htmlengine-edit-images.h" |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | void |
---|
| 32 | html_engine_insert_image (HTMLEngine *e, |
---|
| 33 | const gchar *file, |
---|
| 34 | const gchar *url, |
---|
| 35 | const gchar *target, |
---|
| 36 | gint16 width, |
---|
| 37 | gint16 height, |
---|
| 38 | gboolean percent_width, |
---|
| 39 | gboolean percent_height, |
---|
| 40 | gint8 border, |
---|
| 41 | HTMLColor *border_color, |
---|
| 42 | HTMLHAlignType halign, |
---|
| 43 | HTMLVAlignType valign, |
---|
| 44 | gint8 hspace, |
---|
| 45 | gint8 vspace, |
---|
| 46 | gboolean reload) |
---|
| 47 | { |
---|
| 48 | HTMLObject *image; |
---|
| 49 | |
---|
| 50 | g_return_if_fail (e != NULL); |
---|
| 51 | g_return_if_fail (HTML_IS_ENGINE (e)); |
---|
| 52 | |
---|
[21115] | 53 | image = html_image_new (html_engine_get_image_factory (e), |
---|
[19538] | 54 | file, |
---|
| 55 | url, |
---|
| 56 | target, |
---|
| 57 | width, height, |
---|
| 58 | percent_width, percent_height, |
---|
| 59 | border, |
---|
| 60 | border_color, |
---|
| 61 | valign, reload); |
---|
| 62 | |
---|
| 63 | html_image_set_spacing (HTML_IMAGE (image), hspace, vspace); |
---|
| 64 | |
---|
| 65 | html_engine_paste_object (e, image, 1); |
---|
| 66 | } |
---|