clutter: Drop ClutterZoomGesture's zoom-axis property/methods

This can be done on the caller, seems rarely useful if at all.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2024>
This commit is contained in:
Carlos Garnacho 2021-06-18 17:36:12 +02:00
parent 85bcc48b53
commit 2fc40da1cb
3 changed files with 0 additions and 141 deletions

View File

@ -1429,24 +1429,6 @@ typedef enum
CLUTTER_STEP_MODE_END CLUTTER_STEP_MODE_END
} ClutterStepMode; } ClutterStepMode;
/**
* ClutterZoomAxis:
* @CLUTTER_ZOOM_X_AXIS: Scale only on the X axis
* @CLUTTER_ZOOM_Y_AXIS: Scale only on the Y axis
* @CLUTTER_ZOOM_BOTH: Scale on both axis
*
* The axis of the constraint that should be applied by the
* zooming action.
*
* Since: 1.12
*/
typedef enum /*< prefix=CLUTTER_ZOOM >*/
{
CLUTTER_ZOOM_X_AXIS,
CLUTTER_ZOOM_Y_AXIS,
CLUTTER_ZOOM_BOTH
} ClutterZoomAxis;
/** /**
* ClutterGestureTriggerEdge: * ClutterGestureTriggerEdge:
* @CLUTTER_GESTURE_TRIGGER_EDGE_NONE: Tell #ClutterGestureAction that * @CLUTTER_GESTURE_TRIGGER_EDGE_NONE: Tell #ClutterGestureAction that

View File

@ -76,8 +76,6 @@ struct _ClutterZoomActionPrivate
{ {
ClutterStage *stage; ClutterStage *stage;
ClutterZoomAxis zoom_axis;
ZoomPoint points[2]; ZoomPoint points[2];
graphene_point_t initial_focal_point; graphene_point_t initial_focal_point;
@ -94,17 +92,6 @@ struct _ClutterZoomActionPrivate
gdouble zoom_initial_distance; gdouble zoom_initial_distance;
}; };
enum
{
PROP_0,
PROP_ZOOM_AXIS,
PROP_LAST
};
static GParamSpec *zoom_props[PROP_LAST] = { NULL, };
enum enum
{ {
ZOOM, ZOOM,
@ -235,44 +222,6 @@ clutter_zoom_action_gesture_cancel (ClutterGestureAction *action,
clutter_actor_set_scale (actor, priv->initial_scale_x, priv->initial_scale_y); clutter_actor_set_scale (actor, priv->initial_scale_x, priv->initial_scale_y);
} }
static void
clutter_zoom_action_set_property (GObject *gobject,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterZoomAction *action = CLUTTER_ZOOM_ACTION (gobject);
switch (prop_id)
{
case PROP_ZOOM_AXIS:
clutter_zoom_action_set_zoom_axis (action, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
}
static void
clutter_zoom_action_get_property (GObject *gobject,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterZoomActionPrivate *priv = CLUTTER_ZOOM_ACTION (gobject)->priv;
switch (prop_id)
{
case PROP_ZOOM_AXIS:
g_value_set_enum (value, priv->zoom_axis);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
}
static void static void
clutter_zoom_action_dispose (GObject *gobject) clutter_zoom_action_dispose (GObject *gobject)
{ {
@ -296,33 +245,12 @@ clutter_zoom_action_class_init (ClutterZoomActionClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructed = clutter_zoom_action_constructed; gobject_class->constructed = clutter_zoom_action_constructed;
gobject_class->set_property = clutter_zoom_action_set_property;
gobject_class->get_property = clutter_zoom_action_get_property;
gobject_class->dispose = clutter_zoom_action_dispose; gobject_class->dispose = clutter_zoom_action_dispose;
gesture_class->gesture_begin = clutter_zoom_action_gesture_begin; gesture_class->gesture_begin = clutter_zoom_action_gesture_begin;
gesture_class->gesture_progress = clutter_zoom_action_gesture_progress; gesture_class->gesture_progress = clutter_zoom_action_gesture_progress;
gesture_class->gesture_cancel = clutter_zoom_action_gesture_cancel; gesture_class->gesture_cancel = clutter_zoom_action_gesture_cancel;
/**
* ClutterZoomAction:zoom-axis:
*
* Constraints the zooming action to the specified axis
*
* Since: 1.12
*/
zoom_props[PROP_ZOOM_AXIS] =
g_param_spec_enum ("zoom-axis",
P_("Zoom Axis"),
P_("Constraints the zoom to an axis"),
CLUTTER_TYPE_ZOOM_AXIS,
CLUTTER_ZOOM_BOTH,
CLUTTER_PARAM_READWRITE);
g_object_class_install_properties (gobject_class,
PROP_LAST,
zoom_props);
/** /**
* ClutterZoomAction::zoom: * ClutterZoomAction::zoom:
* @action: the #ClutterZoomAction that emitted the signal * @action: the #ClutterZoomAction that emitted the signal
@ -362,7 +290,6 @@ clutter_zoom_action_init (ClutterZoomAction *self)
ClutterGestureAction *gesture; ClutterGestureAction *gesture;
self->priv = clutter_zoom_action_get_instance_private (self); self->priv = clutter_zoom_action_get_instance_private (self);
self->priv->zoom_axis = CLUTTER_ZOOM_BOTH;
gesture = CLUTTER_GESTURE_ACTION (self); gesture = CLUTTER_GESTURE_ACTION (self);
clutter_gesture_action_set_n_touch_points (gesture, 2); clutter_gesture_action_set_n_touch_points (gesture, 2);
@ -383,50 +310,6 @@ clutter_zoom_action_new (void)
return g_object_new (CLUTTER_TYPE_ZOOM_ACTION, NULL); return g_object_new (CLUTTER_TYPE_ZOOM_ACTION, NULL);
} }
/**
* clutter_zoom_action_set_zoom_axis:
* @action: a #ClutterZoomAction
* @axis: the axis to constraint the zooming to
*
* Restricts the zooming action to a specific axis
*
* Since: 1.12
*/
void
clutter_zoom_action_set_zoom_axis (ClutterZoomAction *action,
ClutterZoomAxis axis)
{
g_return_if_fail (CLUTTER_IS_ZOOM_ACTION (action));
g_return_if_fail (axis >= CLUTTER_ZOOM_X_AXIS &&
axis <= CLUTTER_ZOOM_BOTH);
if (action->priv->zoom_axis == axis)
return;
action->priv->zoom_axis = axis;
g_object_notify_by_pspec (G_OBJECT (action), zoom_props[PROP_ZOOM_AXIS]);
}
/**
* clutter_zoom_action_get_zoom_axis:
* @action: a #ClutterZoomAction
*
* Retrieves the axis constraint set by clutter_zoom_action_set_zoom_axis()
*
* Return value: the axis constraint
*
* Since: 1.12
*/
ClutterZoomAxis
clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action)
{
g_return_val_if_fail (CLUTTER_IS_ZOOM_ACTION (action),
CLUTTER_ZOOM_BOTH);
return action->priv->zoom_axis;
}
/** /**
* clutter_zoom_action_get_focal_point: * clutter_zoom_action_get_focal_point:
* @action: a #ClutterZoomAction * @action: a #ClutterZoomAction

View File

@ -89,12 +89,6 @@ GType clutter_zoom_action_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterAction * clutter_zoom_action_new (void); ClutterAction * clutter_zoom_action_new (void);
CLUTTER_EXPORT
void clutter_zoom_action_set_zoom_axis (ClutterZoomAction *action,
ClutterZoomAxis axis);
CLUTTER_EXPORT
ClutterZoomAxis clutter_zoom_action_get_zoom_axis (ClutterZoomAction *action);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_zoom_action_get_focal_point (ClutterZoomAction *action, void clutter_zoom_action_get_focal_point (ClutterZoomAction *action,
graphene_point_t *point); graphene_point_t *point);