*
* 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"
gint rotation;
gdouble scale;
EvSizingMode sizing_mode;
+ guint continuous : 1;
+ guint dual_page : 1;
+ guint fullscreen : 1;
+ guint inverted_colors : 1;
gdouble max_scale;
gdouble min_scale;
PROP_DOCUMENT,
PROP_PAGE,
PROP_ROTATION,
+ PROP_INVERTED_COLORS,
PROP_SCALE,
- PROP_SIZING_MODE
+ PROP_SIZING_MODE,
+ PROP_CONTINUOUS,
+ PROP_DUAL_PAGE,
+ PROP_FULLSCREEN
};
enum
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;
case PROP_SIZING_MODE:
ev_document_model_set_sizing_mode (model, g_value_get_enum (value));
break;
+ case PROP_CONTINUOUS:
+ ev_document_model_set_continuous (model, g_value_get_boolean (value));
+ break;
+ case PROP_DUAL_PAGE:
+ ev_document_model_set_dual_page (model, g_value_get_boolean (value));
+ break;
+ case PROP_FULLSCREEN:
+ ev_document_model_set_fullscreen (model, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
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;
case PROP_SIZING_MODE:
g_value_set_enum (value, model->sizing_mode);
break;
+ case PROP_CONTINUOUS:
+ g_value_set_boolean (value, ev_document_model_get_continuous (model));
+ break;
+ case PROP_DUAL_PAGE:
+ g_value_set_boolean (value, ev_document_model_get_dual_page (model));
+ break;
+ case PROP_FULLSCREEN:
+ g_value_set_boolean (value, ev_document_model_get_fullscreen (model));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
"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",
EV_TYPE_SIZING_MODE,
EV_SIZING_FIT_WIDTH,
G_PARAM_READWRITE));
+ g_object_class_install_property (g_object_class,
+ PROP_CONTINUOUS,
+ g_param_spec_boolean ("continuous",
+ "Continuous",
+ "Whether document is displayed in continuous mode",
+ TRUE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (g_object_class,
+ PROP_DUAL_PAGE,
+ g_param_spec_boolean ("dual-page",
+ "Dual Page",
+ "Whether document is displayed in dual page mode",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (g_object_class,
+ PROP_FULLSCREEN,
+ g_param_spec_boolean ("fullscreen",
+ "Fullscreen",
+ "Whether document is displayed in fullscreen mode",
+ FALSE,
+ G_PARAM_READWRITE));
/* Signals */
signals [PAGE_CHANGED] =
model->page = -1;
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;
}
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)
+{
+ g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
+
+ continuous = continuous != FALSE;
+
+ if (continuous == model->continuous)
+ return;
+
+ model->continuous = continuous;
+
+ g_object_notify (G_OBJECT (model), "continuous");
+}
+
+gboolean
+ev_document_model_get_continuous (EvDocumentModel *model)
+{
+ g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), TRUE);
+
+ return model->continuous;
+}
+
+void
+ev_document_model_set_dual_page (EvDocumentModel *model,
+ gboolean dual_page)
+{
+ g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
+
+ dual_page = dual_page != FALSE;
+
+ if (dual_page == model->dual_page)
+ return;
+
+ model->dual_page = dual_page;
+
+ g_object_notify (G_OBJECT (model), "dual-page");
+}
+
+gboolean
+ev_document_model_get_dual_page (EvDocumentModel *model)
+{
+ g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);
+
+ return model->dual_page;
+}
+
+void
+ev_document_model_set_fullscreen (EvDocumentModel *model,
+ gboolean fullscreen)
+{
+ g_return_if_fail (EV_IS_DOCUMENT_MODEL (model));
+
+ fullscreen = fullscreen != FALSE;
+
+ if (fullscreen == model->fullscreen)
+ return;
+
+ model->fullscreen = fullscreen;
+
+ g_object_notify (G_OBJECT (model), "fullscreen");
+}
+
+gboolean
+ev_document_model_get_fullscreen (EvDocumentModel *model)
+{
+ g_return_val_if_fail (EV_IS_DOCUMENT_MODEL (model), FALSE);
+
+ return model->fullscreen;
+}