mirror of
https://github.com/brl/mutter.git
synced 2025-01-05 09:12:14 +00:00
clutter: Add IM events
These will be used to make IM commands into something that is processed in a fixed order relative to key events. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1286
This commit is contained in:
parent
3d54f973ce
commit
612a17443a
@ -1097,6 +1097,7 @@ static GQuark quark_touch = 0;
|
|||||||
static GQuark quark_touchpad = 0;
|
static GQuark quark_touchpad = 0;
|
||||||
static GQuark quark_proximity = 0;
|
static GQuark quark_proximity = 0;
|
||||||
static GQuark quark_pad = 0;
|
static GQuark quark_pad = 0;
|
||||||
|
static GQuark quark_im = 0;
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (ClutterActor,
|
G_DEFINE_TYPE_WITH_CODE (ClutterActor,
|
||||||
clutter_actor,
|
clutter_actor,
|
||||||
@ -6006,6 +6007,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
quark_touchpad = g_quark_from_static_string ("touchpad");
|
quark_touchpad = g_quark_from_static_string ("touchpad");
|
||||||
quark_proximity = g_quark_from_static_string ("proximity");
|
quark_proximity = g_quark_from_static_string ("proximity");
|
||||||
quark_pad = g_quark_from_static_string ("pad");
|
quark_pad = g_quark_from_static_string ("pad");
|
||||||
|
quark_im = g_quark_from_static_string ("im");
|
||||||
|
|
||||||
object_class->constructor = clutter_actor_constructor;
|
object_class->constructor = clutter_actor_constructor;
|
||||||
object_class->set_property = clutter_actor_set_property;
|
object_class->set_property = clutter_actor_set_property;
|
||||||
@ -12715,6 +12717,12 @@ clutter_actor_event (ClutterActor *actor,
|
|||||||
signal_num = -1;
|
signal_num = -1;
|
||||||
detail = quark_stage;
|
detail = quark_stage;
|
||||||
break;
|
break;
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
|
signal_num = -1;
|
||||||
|
detail = quark_im;
|
||||||
|
break;
|
||||||
case CLUTTER_EVENT_LAST: /* Just keep compiler warnings quiet */
|
case CLUTTER_EVENT_LAST: /* Just keep compiler warnings quiet */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -906,6 +906,9 @@ typedef enum /*< prefix=CLUTTER >*/
|
|||||||
CLUTTER_PAD_BUTTON_RELEASE,
|
CLUTTER_PAD_BUTTON_RELEASE,
|
||||||
CLUTTER_PAD_STRIP,
|
CLUTTER_PAD_STRIP,
|
||||||
CLUTTER_PAD_RING,
|
CLUTTER_PAD_RING,
|
||||||
|
CLUTTER_IM_COMMIT,
|
||||||
|
CLUTTER_IM_DELETE,
|
||||||
|
CLUTTER_IM_PREEDIT,
|
||||||
|
|
||||||
CLUTTER_EVENT_LAST /* helper */
|
CLUTTER_EVENT_LAST /* helper */
|
||||||
} ClutterEventType;
|
} ClutterEventType;
|
||||||
|
@ -414,6 +414,9 @@ clutter_event_get_position (const ClutterEvent *event,
|
|||||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||||
case CLUTTER_PAD_STRIP:
|
case CLUTTER_PAD_STRIP:
|
||||||
case CLUTTER_PAD_RING:
|
case CLUTTER_PAD_RING:
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
graphene_point_init (position, 0.f, 0.f);
|
graphene_point_init (position, 0.f, 0.f);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -487,6 +490,9 @@ clutter_event_set_coords (ClutterEvent *event,
|
|||||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||||
case CLUTTER_PAD_STRIP:
|
case CLUTTER_PAD_STRIP:
|
||||||
case CLUTTER_PAD_RING:
|
case CLUTTER_PAD_RING:
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_ENTER:
|
case CLUTTER_ENTER:
|
||||||
@ -1104,6 +1110,9 @@ clutter_event_set_device (ClutterEvent *event,
|
|||||||
case CLUTTER_DESTROY_NOTIFY:
|
case CLUTTER_DESTROY_NOTIFY:
|
||||||
case CLUTTER_CLIENT_MESSAGE:
|
case CLUTTER_CLIENT_MESSAGE:
|
||||||
case CLUTTER_EVENT_LAST:
|
case CLUTTER_EVENT_LAST:
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLUTTER_ENTER:
|
case CLUTTER_ENTER:
|
||||||
@ -1199,6 +1208,9 @@ clutter_event_get_device (const ClutterEvent *event)
|
|||||||
case CLUTTER_STAGE_STATE:
|
case CLUTTER_STAGE_STATE:
|
||||||
case CLUTTER_DESTROY_NOTIFY:
|
case CLUTTER_DESTROY_NOTIFY:
|
||||||
case CLUTTER_CLIENT_MESSAGE:
|
case CLUTTER_CLIENT_MESSAGE:
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
case CLUTTER_EVENT_LAST:
|
case CLUTTER_EVENT_LAST:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1407,6 +1419,11 @@ clutter_event_copy (const ClutterEvent *event)
|
|||||||
sizeof (gdouble) * n_axes);
|
sizeof (gdouble) * n_axes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
|
new_event->im.text = g_strdup (event->im.text);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1462,6 +1479,11 @@ clutter_event_free (ClutterEvent *event)
|
|||||||
g_free (event->touch.axes);
|
g_free (event->touch.axes);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
|
g_free (event->im.text);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1756,6 +1778,9 @@ clutter_event_get_axes (const ClutterEvent *event,
|
|||||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||||
case CLUTTER_PAD_STRIP:
|
case CLUTTER_PAD_STRIP:
|
||||||
case CLUTTER_PAD_RING:
|
case CLUTTER_PAD_RING:
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ typedef struct _ClutterProximityEvent ClutterProximityEvent;
|
|||||||
typedef struct _ClutterPadButtonEvent ClutterPadButtonEvent;
|
typedef struct _ClutterPadButtonEvent ClutterPadButtonEvent;
|
||||||
typedef struct _ClutterPadStripEvent ClutterPadStripEvent;
|
typedef struct _ClutterPadStripEvent ClutterPadStripEvent;
|
||||||
typedef struct _ClutterPadRingEvent ClutterPadRingEvent;
|
typedef struct _ClutterPadRingEvent ClutterPadRingEvent;
|
||||||
|
typedef struct _ClutterIMEvent ClutterIMEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterAnyEvent:
|
* ClutterAnyEvent:
|
||||||
@ -544,6 +545,19 @@ struct _ClutterPadRingEvent
|
|||||||
guint32 mode;
|
guint32 mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _ClutterIMEvent
|
||||||
|
{
|
||||||
|
ClutterEventType type;
|
||||||
|
uint32_t time;
|
||||||
|
ClutterEventFlags flags;
|
||||||
|
ClutterStage *stage;
|
||||||
|
ClutterActor *source;
|
||||||
|
|
||||||
|
char *text;
|
||||||
|
int32_t offset;
|
||||||
|
uint32_t len;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClutterEvent:
|
* ClutterEvent:
|
||||||
*
|
*
|
||||||
@ -570,6 +584,7 @@ union _ClutterEvent
|
|||||||
ClutterPadButtonEvent pad_button;
|
ClutterPadButtonEvent pad_button;
|
||||||
ClutterPadStripEvent pad_strip;
|
ClutterPadStripEvent pad_strip;
|
||||||
ClutterPadRingEvent pad_ring;
|
ClutterPadRingEvent pad_ring;
|
||||||
|
ClutterIMEvent im;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1590,6 +1590,9 @@ _clutter_process_event_details (ClutterActor *stage,
|
|||||||
case CLUTTER_PAD_BUTTON_RELEASE:
|
case CLUTTER_PAD_BUTTON_RELEASE:
|
||||||
case CLUTTER_PAD_STRIP:
|
case CLUTTER_PAD_STRIP:
|
||||||
case CLUTTER_PAD_RING:
|
case CLUTTER_PAD_RING:
|
||||||
|
case CLUTTER_IM_COMMIT:
|
||||||
|
case CLUTTER_IM_DELETE:
|
||||||
|
case CLUTTER_IM_PREEDIT:
|
||||||
{
|
{
|
||||||
ClutterActor *actor = NULL;
|
ClutterActor *actor = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user