guint remote_client_iochannel_err;
guint remote_client_iochannel_hup;
int remote_client_id;
- remote_control_focus_in_cb focus_in_cb;
+ remote_control_focus_in_cb focus_in_cb = NULL;
void* focus_in_cb_user_data;
- remote_control_focus_out_cb focus_out_cb;
+ remote_control_focus_out_cb focus_out_cb = NULL;
void* focus_out_cb_user_data;
- remote_control_entry_metadata_cb metadata_cb;
+ remote_control_entry_metadata_cb metadata_cb = NULL;
void* metadata_cb_user_data;
- remote_control_text_updated_cb text_updated_cb;
+ remote_control_text_updated_cb text_updated_cb = NULL;
void* text_updated_cb_user_data;
- remote_control_input_resource_changed_cb input_resource_changed_cb;
+ remote_control_input_resource_changed_cb input_resource_changed_cb = NULL;
void* input_resource_changed_cb_user_data;
};
{
LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_IN");
focus_flag = true;
- client->focus_in_cb (client->focus_in_cb_user_data);
+
+ if (client->focus_in_cb)
+ client->focus_in_cb (client->focus_in_cb_user_data);
break;
}
case REMOTE_CONTROL_CALLBACK_FOCUS_OUT:
{
LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_OUT");
focus_flag = false;
- client->focus_out_cb (client->focus_out_cb_user_data);
+
+ if (client->focus_out_cb)
+ client->focus_out_cb (client->focus_out_cb_user_data);
break;
}
case REMOTE_CONTROL_CALLBACK_ENTRY_METADATA:
LOGD ("REMOTE_CONTROL_CALLBACK_ENTRY_METADATA hint: 0x%04x, layout: %d, variation: %d, autocapital: %d, return_key: %d",
data->hint, data->layout, data->variation, data->autocapital_type, data->return_key_disabled);
- client->metadata_cb (client->metadata_cb_user_data, data);
+
+ if (client->metadata_cb)
+ client->metadata_cb (client->metadata_cb_user_data, data);
delete data;
}
break;
client->remote_client.get_surrounding_text (surrounding_text, &cursor);
SECURE_LOGD ("REMOTE_CONTROL_CALLBACK_TEXT_UPDATED \"%s\" %d", surrounding_text.c_str (), cursor);
- client->text_updated_cb (client->text_updated_cb_user_data, surrounding_text.c_str (), cursor);
+
+ if (client->text_updated_cb)
+ client->text_updated_cb (client->text_updated_cb_user_data, surrounding_text.c_str (), cursor);
}
break;
}
client->remote_client.get_input_resource (&resource);
LOGD ("REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE: %s", (resource ? "REMOTE" : "LOCAL"));
- client->input_resource_changed_cb (client->input_resource_changed_cb_user_data,
- static_cast<remote_control_input_resource> (resource));
+
+ if (client->input_resource_changed_cb)
+ client->input_resource_changed_cb (client->input_resource_changed_cb_user_data,
+ static_cast<remote_control_input_resource> (resource));
}
break;
}