home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / yagirc-0.51.tar.gz / yagirc-0.51.tar / yagirc-0.51 / gui.h < prev    next >
C/C++ Source or Header  |  1998-05-09  |  3KB  |  147 lines

  1. #ifndef USE_GUI
  2. #include "no_ui.h"
  3. #else
  4.  
  5. #include "data.h"
  6.  
  7. #ifndef __GUI_H
  8. #define __GUI_H
  9.  
  10. #include <gdk/gdk.h>
  11. #include <gtk/gtk.h>
  12.  
  13. #define PROGRAM_TITLE "yagIRC"
  14. #define PROGRAM_TITLE_SIZE 6
  15. #define CONFIG_FILE "~/.yagircrc"
  16. #define SITE_CONFIG_FILE "/etc/yagirc.site"
  17. #define GLOBAL_CONFIG_FILE "/etc/yagirc.conf"
  18.  
  19. #define MAX_TEXTLINES_HISTORY 1000
  20.  
  21. typedef struct
  22. {
  23.     GtkWidget *mainwin;
  24.     GtkWidget *entry;
  25.     GtkWidget *statusbar;
  26.     GtkWidget *hbox;
  27.  
  28.     GtkWidget *chanbox; /* channel buttons */
  29.     CHAN_REC *highchan; /* last hilighted channel button */
  30.  
  31.     GList *windows; /* list of child windows in this window */
  32.     WINDOW_REC *selected; /* current selected child window */
  33.  
  34.     GtkWidget *nicklist;
  35.     int nicklistlen;
  36.  
  37.     /* menu */
  38.     GtkMenuFactory *factory;
  39.     GHashTable *entry_ht;
  40.     GtkWidget *menubar;
  41.     GtkAcceleratorTable *table;
  42. }
  43. GUI_TOPWIN_REC;
  44.  
  45. typedef struct
  46. {
  47.     GtkText *text;
  48.     GtkWidget *textscroll;
  49.     GUI_TOPWIN_REC *parent;
  50.  
  51.     int lines;
  52.     int linelen[MAX_TEXTLINES_HISTORY];
  53. }
  54. GUI_WINDOW_REC;
  55.  
  56. typedef struct
  57. {
  58.     GtkWidget *mainwin;
  59.     GtkWidget *progbar;
  60.     GtkWidget *infotext;
  61. }
  62. GUI_DCC_REC;
  63.  
  64. typedef GtkWidget GUI_CHAN_REC;
  65.  
  66. /* Input functions */
  67. typedef GdkInputFunction GUI_INPUT_FUNC;
  68. #define GUI_INPUT_READ GDK_INPUT_READ
  69. #define GUI_INPUT_WRITE GDK_INPUT_WRITE
  70. #define gui_input_add(a,b,c,d) gdk_input_add(a,b,c,d)
  71. #define gui_input_remove(a) gdk_input_remove(a)
  72.  
  73. /* Timeout functions */
  74. typedef GtkFunction GUI_TIMEOUT_FUNC;
  75. #define gui_timeout_new(a,b,c) gtk_timeout_add(a,b,c)
  76. #define gui_timeout_remove(a) gtk_timeout_remove(a)
  77.  
  78. extern GdkColor colors[];
  79. extern GdkColor default_color, default_bgcolor;
  80. extern GdkColor yag_colors[15];
  81.  
  82. enum
  83. {
  84.     NOCOLOR,
  85.     BLACK,
  86.     BLUE,
  87.     GREEN,
  88.     CYAN,
  89.     RED,
  90.     MAGENTA,
  91.     YELLOW,
  92.     WHITE,
  93.     BBLACK,
  94.     BBLUE,
  95.     BGREEN,
  96.     BCYAN,
  97.     BRED,
  98.     BMAGENTA,
  99.     BYELLOW,
  100.     BWHITE,
  101.     COLORS
  102. };
  103.  
  104. /* Initialize IRC window */
  105. void gui_window_init(WINDOW_REC *win, WINDOW_REC *parent);
  106.  
  107. /* Deinitialize IRC window */
  108. void gui_window_deinit(WINDOW_REC *win);
  109.  
  110. /* IRC channel/window changed, update everything you can think of.. */
  111. void gui_window_update(WINDOW_REC *win);
  112.  
  113. /* Change focus to specified window */
  114. void gui_window_select(WINDOW_REC *win);
  115.  
  116. /* Quit program requested */
  117. void gui_exit(void);
  118.  
  119. /* Inform GUI what connection state we are in - 0 = disconnected, 1 = socket
  120.    connected, 2 = IRC server ready */
  121. void gui_connected(SERVER_REC *serv, int state);
  122.  
  123. /* Someone in notify list joined IRC */
  124. void gui_notify_join(char *nick);
  125. /* Someone in notify list left IRC */
  126. void gui_notify_part(char *nick);
  127.  
  128. /* Update status bar */
  129. void gui_update_statusbar(WINDOW_REC *win);
  130.  
  131. #include "gui_dcc.h"
  132. #include "gui_join.h"
  133. #include "gui_connect.h"
  134. #include "gui_channels.h"
  135. #include "gui_nicklist.h"
  136. #include "gui_menu.h"
  137. #include "gui_setup.h"
  138.  
  139. /* private */
  140. int gui_is_sb_down(WINDOW_REC *win);
  141. void gui_set_sb_down(WINDOW_REC *win);
  142. void gui_refresh_windows(void);
  143.  
  144. #endif
  145.  
  146. #endif
  147.