Commit 42baa22c authored by Daiki Ueno's avatar Daiki Ueno

Add doc comment for libeekboard.

parent f07de8cd
......@@ -360,6 +360,12 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
gobject_class->dispose = eekboard_context_service_dispose;
gobject_class->finalize = eekboard_context_service_finalize;
/**
* EekboardContextService::enabled:
* @context: an #EekboardContextService
*
* Emitted when @context is enabled.
*/
signals[ENABLED] =
g_signal_new (I_("enabled"),
G_TYPE_FROM_CLASS(gobject_class),
......@@ -371,6 +377,12 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
G_TYPE_NONE,
0);
/**
* EekboardContextService::disabled:
* @context: an #EekboardContextService
*
* Emitted when @context is enabled.
*/
signals[DISABLED] =
g_signal_new (I_("disabled"),
G_TYPE_FROM_CLASS(gobject_class),
......@@ -382,6 +394,11 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
G_TYPE_NONE,
0);
/**
* EekboardContextService:object-path:
*
* D-Bus object path.
*/
pspec = g_param_spec_string ("object-path",
"Object-path",
"Object-path",
......@@ -391,6 +408,11 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
PROP_OBJECT_PATH,
pspec);
/**
* EekboardContextService:connection:
*
* D-Bus connection.
*/
pspec = g_param_spec_object ("connection",
"Connection",
"Connection",
......@@ -400,6 +422,11 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
PROP_CONNECTION,
pspec);
/**
* EekboardContextService:client-name:
*
* Name of a client who created this context service.
*/
pspec = g_param_spec_string ("client-name",
"Client-name",
"Client-name",
......@@ -409,6 +436,11 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
PROP_CLIENT_NAME,
pspec);
/**
* EekboardContextService:keyboard:
*
* An #EekKeyboard currently active in this context.
*/
pspec = g_param_spec_object ("keyboard",
"Keyboard",
"Keyboard",
......@@ -418,6 +450,11 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
PROP_KEYBOARD,
pspec);
/**
* EekboardContextService:visible:
*
* Flag to indicate if keyboard is visible or not.
*/
pspec = g_param_spec_boolean ("visible",
"Visible",
"Visible",
......@@ -427,6 +464,11 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass)
PROP_VISIBLE,
pspec);
/**
* EekboardContextService:fullscreen:
*
* Flag to indicate if keyboard is rendered in fullscreen mode.
*/
pspec = g_param_spec_boolean ("fullscreen",
"Fullscreen",
"Fullscreen",
......@@ -847,6 +889,13 @@ handle_method_call (GDBusConnection *connection,
g_return_if_reached ();
}
/**
* eekboard_context_service_enable:
* @context: an #EekboardContextService
*
* Enable @context. This function is called when @context is pushed
* by eekboard_service_push_context().
*/
void
eekboard_context_service_enable (EekboardContextService *context)
{
......@@ -872,6 +921,13 @@ eekboard_context_service_enable (EekboardContextService *context)
}
}
/**
* eekboard_context_service_disable:
* @context: an #EekboardContextService
*
* Disable @context. This function is called when @context is pushed
* by eekboard_service_pop_context().
*/
void
eekboard_context_service_disable (EekboardContextService *context)
{
......@@ -897,13 +953,27 @@ eekboard_context_service_disable (EekboardContextService *context)
}
}
const EekKeyboard *
/**
* eekboard_context_service_get_keyboard:
* @context: an #EekboardContextService
*
* Get keyboard currently active in @context.
* Returns: (transfer none): an #EekKeyboard
*/
EekKeyboard *
eekboard_context_service_get_keyboard (EekboardContextService *context)
{
EekboardContextServicePrivate *priv = EEKBOARD_CONTEXT_SERVICE_GET_PRIVATE(context);
return priv->keyboard;
}
/**
* eekboard_context_service_get_fullscreen:
* @context: an #EekboardContextService
*
* Check if keyboard is rendered in fullscreen mode in @context.
* Returns: %TRUE or %FALSE
*/
gboolean
eekboard_context_service_get_fullscreen (EekboardContextService *context)
{
......@@ -911,6 +981,13 @@ eekboard_context_service_get_fullscreen (EekboardContextService *context)
return priv->fullscreen;
}
/**
* eekboard_context_service_get_client_name:
* @context: an #EekboardContextService
*
* Get the name of client which created @context.
* Returns: (transfer none): a string
*/
const gchar *
eekboard_context_service_get_client_name (EekboardContextService *context)
{
......
......@@ -40,16 +40,31 @@ typedef struct _EekboardContextService EekboardContextService;
typedef struct _EekboardContextServiceClass EekboardContextServiceClass;
typedef struct _EekboardContextServicePrivate EekboardContextServicePrivate;
/**
* EekboardContextService:
*
* The #EekboardContextService structure contains only private data
* and should only be accessed using the provided API.
*/
struct _EekboardContextService {
GObject parent;
EekboardContextServicePrivate *priv;
};
/**
* EekboardContextServiceClass:
* @create_keyboard: virtual function for create a keyboard from string
* @show_keyboard: virtual function for show a keyboard
* @hide_keyboard: virtual function for hide a keyboard
* @enabled: class handler for #EekboardContextService::enabled signal
* @disabled: class handler for #EekboardContextService::disabled signal
*/
struct _EekboardContextServiceClass {
/*< private >*/
GObjectClass parent_class;
/*< public >*/
EekKeyboard *(*create_keyboard) (EekboardContextService *self,
const gchar *keyboard_type);
void (*show_keyboard) (EekboardContextService *self);
......@@ -64,18 +79,16 @@ struct _EekboardContextServiceClass {
gpointer pdummy[24];
};
GType eekboard_context_service_get_type
(void) G_GNUC_CONST;
void eekboard_context_service_enable
(EekboardContextService *context);
void eekboard_context_service_disable
(EekboardContextService *context);
const EekKeyboard *eekboard_context_service_get_keyboard
(EekboardContextService *context);
gboolean eekboard_context_service_get_fullscreen
(EekboardContextService *context);
const gchar * eekboard_context_service_get_client_name
(EekboardContextService *context);
GType eekboard_context_service_get_type
(void) G_GNUC_CONST;
void eekboard_context_service_enable (EekboardContextService *context);
void eekboard_context_service_disable (EekboardContextService *context);
EekKeyboard *eekboard_context_service_get_keyboard
(EekboardContextService *context);
gboolean eekboard_context_service_get_fullscreen
(EekboardContextService *context);
const gchar * eekboard_context_service_get_client_name
(EekboardContextService *context);
G_END_DECLS
#endif /* EEKBOARD_CONTEXT_SERVICE_H */
......@@ -247,6 +247,11 @@ eekboard_service_class_init (EekboardServiceClass *klass)
G_TYPE_NONE,
0);
/**
* EekboardService:object-path:
*
* D-Bus object path.
*/
pspec = g_param_spec_string ("object-path",
"Object-path",
"Object-path",
......@@ -256,6 +261,11 @@ eekboard_service_class_init (EekboardServiceClass *klass)
PROP_OBJECT_PATH,
pspec);
/**
* EekboardService:connection:
*
* D-Bus connection.
*/
pspec = g_param_spec_object ("connection",
"Connection",
"Connection",
......@@ -477,9 +487,16 @@ handle_method_call (GDBusConnection *connection,
g_return_if_reached ();
}
/**
* eekboard_service_new:
* @connection: a #GDBusConnection
* @object_path: object path
*
* Create an empty server for testing purpose.
*/
EekboardService *
eekboard_service_new (const gchar *object_path,
GDBusConnection *connection)
eekboard_service_new (GDBusConnection *connection,
const gchar *object_path)
{
return g_object_new (EEKBOARD_TYPE_SERVICE,
"object-path", object_path,
......
......@@ -38,12 +38,23 @@ typedef struct _EekboardService EekboardService;
typedef struct _EekboardServiceClass EekboardServiceClass;
typedef struct _EekboardServicePrivate EekboardServicePrivate;
/**
* EekboardService:
*
* The #EekboardService structure contains only private data and
* should only be accessed using the provided API.
*/
struct _EekboardService {
/*< private >*/
GObject parent;
EekboardServicePrivate *priv;
};
/**
* EekboardServiceClass:
* @create_context: virtual function for creating a context
*/
struct _EekboardServiceClass {
/*< private >*/
GObjectClass parent_class;
......@@ -59,8 +70,8 @@ struct _EekboardServiceClass {
};
GType eekboard_service_get_type (void) G_GNUC_CONST;
EekboardService * eekboard_service_new (const gchar *object_path,
GDBusConnection *connection);
EekboardService * eekboard_service_new (GDBusConnection *connection,
const gchar *object_path);
G_END_DECLS
#endif /* EEKBOARD_SERVICE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment