static void start_command (AnjutaCommand *command) { guint return_code; return_code = ANJUTA_COMMAND_GET_CLASS (command)->run (command); anjuta_command_notify_complete (command, return_code); }
static gpointer anjuta_async_command_thread (AnjutaCommand *command) { guint return_code; return_code = ANJUTA_COMMAND_GET_CLASS (command)->run (command); anjuta_command_notify_complete (command, return_code); return NULL; }
/** * anjuta_async_command_set_error_message: * @command: AnjutaAsyncCommand object * @error_message: The error message that should be used * * Set the error message this async command resulted in */ void anjuta_async_command_set_error_message (AnjutaCommand *command, const gchar *error_message) { anjuta_async_command_lock (ANJUTA_ASYNC_COMMAND (command)); ANJUTA_COMMAND_GET_CLASS (command)->set_error_message (command, error_message); anjuta_async_command_unlock (ANJUTA_ASYNC_COMMAND (command)); }
/** * anjuta_command_start: * @self: Command object to start * * Starts a command. Client code can handle data from the command by connecting * to the ::data-arrived signal. * * #AnjutaCommand subclasses should override this method to determine how they * call ::run, which actually does the command's legwork. */ void anjuta_command_start (AnjutaCommand *self) { if (!self->priv->running) { g_signal_emit_by_name (self, "command-started"); ANJUTA_COMMAND_GET_CLASS (self)->start (self); } }
/** * anjuta_async_command_get_error_message: * @command: AnjutaAsyncCommand object * * Returns: The error message the async command resulted in. The caller * should free the string */ gchar * anjuta_async_command_get_error_message (AnjutaCommand *command) { gchar *error_message; anjuta_async_command_lock (ANJUTA_ASYNC_COMMAND (command)); error_message = ANJUTA_COMMAND_GET_CLASS (command)->get_error_message (command); anjuta_async_command_unlock (ANJUTA_ASYNC_COMMAND (command)); return error_message; }
/** * anjuta_command_stop_automatic_monitor: * @self: Command object. * * Stops automatic monitoring for self executing commands. For commands that * do not support self-starting, this function does nothing. */ void anjuta_command_stop_automatic_monitor (AnjutaCommand *self) { ANJUTA_COMMAND_GET_CLASS (self)->stop_automatic_monitor (self); }
/** * anjuta_command_start_automatic_monitor: * @self: Command object. * * Sets up any monitoring needed for commands that should start themselves * automatically in response to some event. * * Return value: %TRUE if automatic starting is supported by the command and * no errors were encountered; %FALSE if automatic starting is unsupported or on * error. */ gboolean anjuta_command_start_automatic_monitor (AnjutaCommand *self) { return ANJUTA_COMMAND_GET_CLASS (self)->start_automatic_monitor (self); }
/** * anjuta_command_notify_progress: * @self: Command object. * @progress: The of the command that is passed to the notify callback * * Emits the ::progress signal. Can be used by both base classes and * commands as needed. */ void anjuta_command_notify_progress (AnjutaCommand *self, gfloat progress) { ANJUTA_COMMAND_GET_CLASS (self)->notify_progress (self, progress); }
/** * anjuta_command_notify_complete: * @self: Command object * @return_code: The returned code that is passed to the notify callback * * Used by base classes derived from #AnjutaCommand to emit the * ::command-finished signal. This method should not be used by client code or * #AnjutaCommand objects that are not base classes. */ void anjuta_command_notify_complete (AnjutaCommand *self, guint return_code) { ANJUTA_COMMAND_GET_CLASS (self)->notify_complete (self, return_code); }
/** * anjuta_command_notify_data_arrived: * @self: Command object. * * Used by base classes derived from #AnjutaCommand to emit the ::data-arrived * signal. This method should be used by both base command classes and * non-base classes as appropriate. */ void anjuta_command_notify_data_arrived (AnjutaCommand *self) { ANJUTA_COMMAND_GET_CLASS (self)->notify_data_arrived (self); }
/** * anjuta_command_cancel: * @self: Command object. * * Cancels a running command. */ void anjuta_command_cancel (AnjutaCommand *self) { ANJUTA_COMMAND_GET_CLASS (self)->cancel (self); }