home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / gtk_v99filesel.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  3.6 KB  |  132 lines

  1. /*
  2.  *    Adapted from gtkfilesel.h to add callback capability
  3.  *
  4.  *
  5.  */
  6.  
  7. #ifndef __V99_FILESEL_H__
  8. #define __V99_FILESEL_H__
  9.  
  10.  
  11. #include <gdk/gdk.h>
  12. #include <gtk/gtkwindow.h>
  13. #include <gtk/gtkclist.h>
  14.  
  15. #ifdef __cplusplus
  16. //extern "C" {
  17. #endif /* __cplusplus */
  18.  
  19.  
  20. #define V99_TYPE_FILE_SELECTION            (v99_file_selection_get_type ())
  21. #define V99_FILE_SELECTION(obj)            (GTK_CHECK_CAST ((obj), V99_TYPE_FILE_SELECTION, V99FileSelection))
  22. #define V99_FILE_SELECTION_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), V99_TYPE_FILE_SELECTION, V99FileSelectionClass))
  23. #define V99_IS_FILE_SELECTION(obj)         (GTK_CHECK_TYPE ((obj), V99_TYPE_FILE_SELECTION))
  24. #define V99_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), V99_TYPE_FILE_SELECTION))
  25.  
  26.  
  27. typedef struct _V99FileSelection       V99FileSelection;
  28. typedef struct _V99FileSelectionClass  V99FileSelectionClass;
  29.  
  30. //    Callback to translate a filename entry into an item to add to the file_list
  31. //typedef gchar *  (*v99_file_selection_file_set)(V99FileSelection *fs, gchar *text);
  32.  
  33. //    Callback to translate an item in the clist into a filename for caller
  34. typedef gchar *  (*v99_file_selection_file_get)(V99FileSelection *fs, 
  35.                                                 GtkCList *clist,
  36.                                                 int row,
  37.                                                 gchar **text);
  38.  
  39. //    Callback to translate a filename entry into an item to add to the file_list
  40. typedef int (*v99_file_selection_file_append)(V99FileSelection *fs, 
  41.                                               GtkCList *clist,
  42.                                               const gchar *path,
  43.                                               const gchar *text);
  44.  
  45. struct _V99FileSelection
  46. {
  47.     GtkWindow window;
  48.  
  49.     GtkWidget *dir_list;
  50.     GtkWidget *file_list;
  51.  
  52.     GtkWidget *list_hbox;
  53.     GtkWidget *file_list_scrolled_win;
  54.     GtkWidget *dir_list_scrolled_win;
  55.  
  56.     guint     file_list_select_row_handler_id;
  57.  
  58.     GtkWidget *selection_entry;
  59.     GtkWidget *selection_text;
  60.     GtkWidget *main_vbox;
  61.     GtkWidget *ok_button;
  62.     GtkWidget *cancel_button;
  63.     GtkWidget *help_button;
  64.     GtkWidget *history_pulldown;
  65.     GtkWidget *history_menu;
  66.     GList     *history_list;
  67.     GtkWidget *fileop_dialog;
  68.     GtkWidget *fileop_entry;
  69.     gchar     *fileop_file;
  70.     gpointer   cmpl_state;
  71.   
  72.     GtkWidget *fileop_c_dir;
  73.     GtkWidget *fileop_del_file;
  74.     GtkWidget *fileop_ren_file;
  75.   
  76.     GtkWidget *button_area;
  77.     GtkWidget *action_area;
  78.  
  79.      GtkWidget *path_list_vbox;
  80.  
  81.     gboolean  active_file_list;
  82.  
  83.     gpointer user_data;
  84.     v99_file_selection_file_append user_file_append;
  85.     v99_file_selection_file_get user_file_get;
  86. };
  87.  
  88. struct _V99FileSelectionClass
  89. {
  90.   GtkWindowClass parent_class;
  91. };
  92.  
  93.  
  94. GtkType    v99_file_selection_get_type            (void);
  95. GtkWidget* v99_file_selection_new                 (const gchar      *title);
  96. void       v99_file_selection_set_filename        (V99FileSelection *filesel,
  97.                            const gchar      *filename);
  98. gchar*     v99_file_selection_get_filename        (V99FileSelection *filesel);
  99. void       v99_file_selection_complete          (V99FileSelection *filesel,
  100.                            const gchar        *pattern);
  101. void       v99_file_selection_show_fileop_buttons (V99FileSelection *filesel);
  102. void       v99_file_selection_hide_fileop_buttons (V99FileSelection *filesel);
  103.  
  104. void        v99_file_selection_set_file_list_columns(V99FileSelection *filesel,
  105.                                                      int columns,
  106.                                                      gchar *titles[],
  107.                                                      v99_file_selection_file_append ahandler,
  108.                                                      v99_file_selection_file_get ghandler);
  109. void        v99_file_selection_set_file_list_active(V99FileSelection *filesel, 
  110.                                                     gboolean active);
  111.  
  112. GtkCList    *v99_file_selection_add_path_list(V99FileSelection *filesel,
  113.                                          gchar *path_list_name,
  114.                                          gchar *path_list);
  115.  
  116. #ifdef __cplusplus
  117. }
  118. #endif /* __cplusplus */
  119.  
  120.  
  121. #endif /* __V99_FILESEL_H__ */
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.