/*!
* \brief
+ * Update the provider control
+ * \see provider_control
+ * MUST HAS TO BE SYNC'd WITH THE DATA-PROVIDER-MASTER
+ */
+enum PROVIDER_CTRL {
+ PROVIDER_CTRL_DEFAULT = 0x00, /*!< Set default control operation */
+ PROVIDER_CTRL_MANUAL_TERMINATION = 0x01, /*!< Terminate process manually */
+ PROVIDER_CTRL_MANUAL_REACTIVATION = 0x02, /*!< Reactivate process manually */
+};
+
+/*!
+ * \brief
* Text signal & Content event uses this data structure.
*/
struct event_info {
* \see provider_send_key_status
*/
extern int provider_send_request_close_pd(const char *pkgname, const char *id, int reason);
+
+/*!
+ * \brief Change the provider control policy.
+ * \details N/A
+ * \remarks N/A
+ * \param[in] ctrl enumeration list - enum PROVIDER_CTRL
+ * \return int
+ * \retval LB_STATUS_SUCCESS Successfully changed
+ * \pre
+ * \post
+ */
+extern int provider_control(int ctrl);
/*!
* \}
*/
gap = gem->dri2_buffer->pitch - (gem->w * gem->depth);
for (y = 0; y < gem->h; y++) {
- for (x = 0; x < gem->w; x++)
+ for (x = 0; x < gem->w; x++) {
*gem_pixel++ = *pixel++;
+ }
gem_pixel = (int *)(((char *)gem_pixel) + gap);
}
#include "fb.h"
static struct info {
+ int closing_fd;
int fd;
char *name;
struct event_handler table;
void *data;
int prevent_overwrite;
} s_info = {
+ .closing_fd = 0,
.fd = -1,
.name = NULL,
.data = NULL,
return NULL;
}
+struct packet *master_disconnect(pid_t pid, int handle, const struct packet *packet)
+{
+ double timestamp;
+ int ret;
+
+ ret = packet_get(packet, "d", ×tamp);
+ if (ret != 1) {
+ ErrPrint("Invalid packet\n");
+ goto errout;
+ }
+
+ if (s_info.fd >= 0 && s_info.closing_fd == 0) {
+ s_info.closing_fd = 1;
+ com_core_packet_client_fini(s_info.fd);
+ s_info.fd = -1;
+ s_info.closing_fd = 0;
+ }
+
+errout:
+ return NULL;
+}
+
struct packet *master_pd_move(pid_t pid, int handle, const struct packet *packet)
{
struct event_arg arg;
.cmd = "update_mode",
.handler = master_update_mode,
},
+ {
+ .cmd = "disconnect",
+ .handler = master_disconnect,
+ },
{
.cmd = NULL,
provider_fini_called = 1;
- if (s_info.fd >= 0) {
+ if (s_info.fd >= 0 && s_info.closing_fd == 0) {
+ s_info.closing_fd = 1;
com_core_packet_client_fini(s_info.fd);
s_info.fd = -1;
+ s_info.closing_fd = 0;
}
provider_fini_called = 0;
return s_info.name;
}
+EAPI int provider_control(int ctrl)
+{
+ struct packet *packet;
+ int ret;
+
+ if (s_info.fd < 0) {
+ ErrPrint("Connection is not established\n");
+ return LB_STATUS_ERROR_INVALID;
+ }
+
+ packet = packet_create_noack("ctrl", "i", ctrl);
+ if (!packet) {
+ ErrPrint("Failed to build a packet\n");
+ return LB_STATUS_ERROR_FAULT;
+ }
+
+ ret = com_core_packet_send_only(s_info.fd, packet);
+ packet_destroy(packet);
+
+ DbgPrint("[CTRL] Request: 0x%x\n", (unsigned int)ctrl);
+ return ret < 0 ? LB_STATUS_ERROR_FAULT : LB_STATUS_SUCCESS;
+}
+
/* End of a file */