5#include "flutter/shell/platform/linux/public/flutter_linux/fl_method_response.h"
29G_DEFINE_TYPE(FlMethodResponse, fl_method_response, G_TYPE_OBJECT)
31 fl_method_success_response,
40static
void fl_method_response_class_init(FlMethodResponseClass* klass) {}
45 FlMethodSuccessResponse*
self = FL_METHOD_SUCCESS_RESPONSE(
object);
49 G_OBJECT_CLASS(fl_method_success_response_parent_class)->dispose(
object);
53 FlMethodSuccessResponseClass* klass) {
60 FlMethodErrorResponse*
self = FL_METHOD_ERROR_RESPONSE(
object);
62 g_clear_pointer(&
self->code, g_free);
63 g_clear_pointer(&
self->message, g_free);
66 G_OBJECT_CLASS(fl_method_error_response_parent_class)->dispose(
object);
70 FlMethodErrorResponseClass* klass) {
77 FlMethodNotImplementedResponseClass* klass) {}
80 FlMethodNotImplementedResponse*
self) {}
84 if (FL_IS_METHOD_SUCCESS_RESPONSE(
self)) {
86 FL_METHOD_SUCCESS_RESPONSE(
self));
89 if (FL_IS_METHOD_ERROR_RESPONSE(
self)) {
96 g_autofree gchar* details_text =
nullptr;
97 if (details !=
nullptr) {
101 g_autoptr(GString) error_message = g_string_new(
"");
102 g_string_append_printf(error_message,
"Remote code returned error %s",
105 g_string_append_printf(error_message,
": %s",
message);
107 if (details_text !=
nullptr) {
108 g_string_append_printf(error_message,
" %s", details_text);
114 }
else if (FL_IS_METHOD_NOT_IMPLEMENTED_RESPONSE(
self)) {
117 "Requested method is not implemented");
128 FlMethodSuccessResponse*
self = FL_METHOD_SUCCESS_RESPONSE(
129 g_object_new(fl_method_success_response_get_type(),
nullptr));
139 FlMethodSuccessResponse*
self) {
140 g_return_val_if_fail(FL_IS_METHOD_SUCCESS_RESPONSE(
self),
nullptr);
148 g_return_val_if_fail(
code !=
nullptr,
nullptr);
150 FlMethodErrorResponse*
self = FL_METHOD_ERROR_RESPONSE(
151 g_object_new(fl_method_error_response_get_type(),
nullptr));
161 FlMethodErrorResponse*
self) {
162 g_return_val_if_fail(FL_IS_METHOD_ERROR_RESPONSE(
self),
nullptr);
167 FlMethodErrorResponse*
self) {
168 g_return_val_if_fail(FL_IS_METHOD_ERROR_RESPONSE(
self),
nullptr);
169 return self->message;
173 FlMethodErrorResponse*
self) {
174 g_return_val_if_fail(FL_IS_METHOD_ERROR_RESPONSE(
self),
nullptr);
175 return self->details;
178G_MODULE_EXPORT FlMethodNotImplementedResponse*
180 return FL_METHOD_NOT_IMPLEMENTED_RESPONSE(
181 g_object_new(fl_method_not_implemented_response_get_type(),
nullptr));
G_DEFINE_QUARK(fl_binary_messenger_codec_error_quark, fl_binary_messenger_codec_error) G_DECLARE_FINAL_TYPE(FlBinaryMessengerImpl
G_DEFINE_TYPE(FlMethodSuccessResponse, fl_method_success_response, fl_method_response_get_type()) G_DEFINE_TYPE(FlMethodErrorResponse
fl_method_not_implemented_response
static void fl_method_error_response_class_init(FlMethodErrorResponseClass *klass)
G_MODULE_EXPORT FlValue * fl_method_response_get_result(FlMethodResponse *self, GError **error)
static void fl_method_error_response_dispose(GObject *object)
static void fl_method_not_implemented_response_init(FlMethodNotImplementedResponse *self)
static void fl_method_response_init(FlMethodResponse *self)
static void fl_method_success_response_class_init(FlMethodSuccessResponseClass *klass)
G_MODULE_EXPORT FlValue * fl_method_success_response_get_result(FlMethodSuccessResponse *self)
static void fl_method_success_response_init(FlMethodSuccessResponse *self)
G_MODULE_EXPORT FlMethodErrorResponse * fl_method_error_response_new(const gchar *code, const gchar *message, FlValue *details)
static void fl_method_error_response_init(FlMethodErrorResponse *self)
static void fl_method_not_implemented_response_class_init(FlMethodNotImplementedResponseClass *klass)
static void fl_method_success_response_dispose(GObject *object)
G_MODULE_EXPORT const gchar * fl_method_error_response_get_message(FlMethodErrorResponse *self)
G_MODULE_EXPORT FlMethodSuccessResponse * fl_method_success_response_new(FlValue *result)
fl_method_response_get_type()) G_DEFINE_TYPE(FlMethodNotImplementedResponse
G_MODULE_EXPORT FlValue * fl_method_error_response_get_details(FlMethodErrorResponse *self)
G_MODULE_EXPORT const gchar * fl_method_error_response_get_code(FlMethodErrorResponse *self)
G_MODULE_EXPORT FlMethodNotImplementedResponse * fl_method_not_implemented_response_new()
@ FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED
@ FL_METHOD_RESPONSE_ERROR_FAILED
@ FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR
#define FL_METHOD_RESPONSE_ERROR
G_MODULE_EXPORT GQuark fl_method_response_error_quark(void) G_GNUC_CONST
const uint8_t uint32_t uint32_t GError ** error
G_MODULE_EXPORT FlValue * fl_value_ref(FlValue *self)
G_MODULE_EXPORT gchar * fl_value_to_string(FlValue *value)
G_MODULE_EXPORT void fl_value_unref(FlValue *self)
typedefG_BEGIN_DECLS struct _FlValue FlValue
FlMethodResponse parent_instance
FlMethodResponse parent_instance
FlMethodResponse parent_instance