mssh-terminal.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef __MSSH_TERMINAL_H__
  2. #define __MSSH_TERMINAL_H__
  3. #include <gtk/gtk.h>
  4. #include <vte/vte.h>
  5. G_BEGIN_DECLS
  6. #define MSSH_TYPE_TERMINAL mssh_terminal_get_type()
  7. #define MSSH_TERMINAL(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
  8. MSSH_TYPE_TERMINAL, MSSHTerminal)
  9. #define MSSH_TERMINAL_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, \
  10. MSSH_TERMINAL_TYPE, MSSHTerminalClass)
  11. #define IS_MSSH_TERMINAL(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
  12. MSSH_TYPE_TERMINAL)
  13. #define IS_MSSH_TERMINAL_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, \
  14. MSSH_TYPE_TERMINAL)
  15. typedef struct
  16. {
  17. VteTerminal vte;
  18. GtkWidget *menu_item;
  19. char *hostname;
  20. int started;
  21. int ended;
  22. gint backscroll_buffer_size;
  23. } MSSHTerminal;
  24. typedef struct
  25. {
  26. VteTerminalClass parent_class;
  27. guint session_closed_signal;
  28. guint session_focused_signal;
  29. void (*session_closed)(MSSHTerminal *terminal);
  30. void (*session_focused)(MSSHTerminal *terminal);
  31. } MSSHTerminalClass;
  32. GType mssh_terminal_get_type(void) G_GNUC_CONST;
  33. GtkWidget* mssh_terminal_new(void);
  34. void mssh_terminal_destroy(MSSHTerminal *terminal);
  35. gboolean mssh_terminal_isactive(MSSHTerminal *terminal);
  36. void mssh_terminal_init_session(MSSHTerminal *terminal, char *hostname);
  37. void mssh_terminal_set_backscroll_size(MSSHTerminal *terminal, gint *backscroll_buffer_size);
  38. void mssh_terminal_start_session(MSSHTerminal *terminal, char **env);
  39. void mssh_terminal_send_host(MSSHTerminal *terminal);
  40. void mssh_terminal_send_string(MSSHTerminal *terminal, gchar *string);
  41. void mssh_terminal_send_data(MSSHTerminal *terminal, GdkEventKey *event);
  42. G_END_DECLS
  43. #endif /* __MSSH_TERMINAL_H__ */