mssh-terminal.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. } MSSHTerminal;
  23. typedef struct
  24. {
  25. VteTerminalClass parent_class;
  26. guint session_closed_signal;
  27. guint session_focused_signal;
  28. void (*session_closed)(MSSHTerminal *terminal);
  29. void (*session_focused)(MSSHTerminal *terminal);
  30. } MSSHTerminalClass;
  31. GType mssh_terminal_get_type(void) G_GNUC_CONST;
  32. GtkWidget* mssh_terminal_new(void);
  33. void mssh_terminal_destroy(MSSHTerminal *terminal);
  34. gboolean mssh_terminal_isactive(MSSHTerminal *terminal);
  35. void mssh_terminal_init_session(MSSHTerminal *terminal, char *hostname);
  36. void mssh_terminal_start_session(MSSHTerminal *terminal, char **env);
  37. void mssh_terminal_send_host(MSSHTerminal *terminal);
  38. void mssh_terminal_send_string(MSSHTerminal *terminal, gchar *string);
  39. void mssh_terminal_send_data(MSSHTerminal *terminal, GdkEventKey *event);
  40. G_END_DECLS
  41. #endif /* __MSSH_TERMINAL_H__ */