X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=libview%2Fev-document-model.c;h=727264a09b5b692c00774b64e776fa094ccaf4fe;hb=c53e0983d86042d243786f7f8dd4872f83706390;hp=2e3db25cedd4573f24b5d5a69e1f5f32d1e2d2ab;hpb=c4be37f1134e65733ed808d10108234da0345d45;p=evince.git diff --git a/libview/ev-document-model.c b/libview/ev-document-model.c index 2e3db25c..727264a0 100644 --- a/libview/ev-document-model.c +++ b/libview/ev-document-model.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" @@ -38,6 +38,7 @@ struct _EvDocumentModel guint continuous : 1; guint dual_page : 1; guint fullscreen : 1; + guint inverted_colors : 1; gdouble max_scale; gdouble min_scale; @@ -58,6 +59,7 @@ enum { PROP_DOCUMENT, PROP_PAGE, PROP_ROTATION, + PROP_INVERTED_COLORS, PROP_SCALE, PROP_SIZING_MODE, PROP_CONTINUOUS, @@ -106,6 +108,9 @@ ev_document_model_set_property (GObject *object, case PROP_ROTATION: ev_document_model_set_rotation (model, g_value_get_int (value)); break; + case PROP_INVERTED_COLORS: + ev_document_model_set_inverted_colors (model, g_value_get_boolean (value)); + break; case PROP_SCALE: ev_document_model_set_scale (model, g_value_get_double (value)); break; @@ -144,6 +149,9 @@ ev_document_model_get_property (GObject *object, case PROP_ROTATION: g_value_set_int (value, model->rotation); break; + case PROP_INVERTED_COLORS: + g_value_set_boolean (value, model->inverted_colors); + break; case PROP_SCALE: g_value_set_double (value, model->scale); break; @@ -195,6 +203,13 @@ ev_document_model_class_init (EvDocumentModelClass *klass) "Current rotation angle", 0, 360, 0, G_PARAM_READWRITE)); + g_object_class_install_property (g_object_class, + PROP_INVERTED_COLORS, + g_param_spec_boolean ("inverted-colors", + "Inverted Colors", + "Whether document is displayed with inverted colors", + FALSE, + G_PARAM_READWRITE)); g_object_class_install_property (g_object_class, PROP_SCALE, g_param_spec_double ("scale", @@ -251,6 +266,7 @@ ev_document_model_init (EvDocumentModel *model) model->scale = 1.; model->sizing_mode = EV_SIZING_FIT_WIDTH; model->continuous = TRUE; + model->inverted_colors = FALSE; model->min_scale = 0.; model->max_scale = G_MAXDOUBLE; } @@ -460,6 +476,28 @@ ev_document_model_get_rotation (EvDocumentModel *model) return model->rotation; } +void +ev_document_model_set_inverted_colors (EvDocumentModel *model, + gboolean inverted_colors) +{ + g_return_if_fail (EV_IS_DOCUMENT_MODEL (model)); + + if (inverted_colors == model->inverted_colors) + return; + + model->inverted_colors = inverted_colors; + + g_object_notify (G_OBJECT (model), "inverted-colors"); +} + +gboolean +ev_document_model_get_inverted_colors (EvDocumentModel *model) +{ + g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE); + + return model->inverted_colors; +} + void ev_document_model_set_continuous (EvDocumentModel *model, gboolean continuous)