]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - dialog.h
Fix handle leak in winhandl.c.
[PuTTY.git] / dialog.h
index eb7ce0e956fb90fe2301d9047cba584ab9c8651d..6f454f566c2e12a1055ac3f497bd082d1c0ac42b 100644 (file)
--- a/dialog.h
+++ b/dialog.h
@@ -345,6 +345,12 @@ union control {
         */
        int ncols;                     /* number of columns */
        int *percentages;              /* % width of each column */
+        /*
+         * Flag which can be set to FALSE to suppress the horizontal
+         * scroll bar if a list box entry goes off the right-hand
+         * side.
+         */
+        int hscroll;
     } listbox;
     struct {
        STANDARD_PREFIX;
@@ -427,6 +433,8 @@ struct controlset {
     union control **ctrls;            /* actual array */
 };
 
+typedef void (*ctrl_freefn_t)(void *);    /* used by ctrl_alloc_with_free */
+
 /*
  * This is the container structure which holds a complete set of
  * controls.
@@ -438,6 +446,7 @@ struct controlbox {
     int nfrees;
     int freesize;
     void **frees;                     /* array of aux data areas to free */
+    ctrl_freefn_t *freefuncs;          /* parallel array of free functions */
 };
 
 struct controlbox *ctrl_new_box(void);
@@ -464,8 +473,14 @@ void ctrl_free(union control *);
  * and so data allocated through this function is better not used
  * to hold modifiable per-instance things. It's mostly here for
  * allocating structures to be passed as control handler params.
+ *
+ * ctrl_alloc_with_free also allows you to provide a function to free
+ * the structure, in case there are other dynamically allocated bits
+ * and pieces dangling off it.
  */
 void *ctrl_alloc(struct controlbox *b, size_t size);
+void *ctrl_alloc_with_free(struct controlbox *b, size_t size,
+                           ctrl_freefn_t freefunc);
 
 /*
  * Individual routines to create `union control' structures in a controlset.
@@ -521,21 +536,6 @@ union control *ctrl_checkbox(struct controlset *, char *label, char shortcut,
                             handler_fn handler, intorptr context);
 union control *ctrl_tabdelay(struct controlset *, union control *);
 
-/*
- * The standard file-selector handler expects the main `context'
- * field to contain the `offsetof' a Filename field in the
- * structure pointed to by `data'.
- */
-void dlg_stdfilesel_handler(union control *ctrl, void *dlg,
-                           void *data, int event);
-/*
- * The standard font-selector handler expects the main `context'
- * field to contain the `offsetof' a Font field in the structure
- * pointed to by `data'.
- */
-void dlg_stdfontsel_handler(union control *ctrl, void *dlg,
-                           void *data, int event);
-
 /*
  * Routines the platform-independent dialog code can call to read
  * and write the values of controls.
@@ -565,8 +565,8 @@ int dlg_listbox_index(union control *ctrl, void *dlg);
 int dlg_listbox_issel(union control *ctrl, void *dlg, int index);
 void dlg_listbox_select(union control *ctrl, void *dlg, int index);
 void dlg_text_set(union control *ctrl, void *dlg, char const *text);
-void dlg_filesel_set(union control *ctrl, void *dlg, Filename fn);
-void dlg_filesel_get(union control *ctrl, void *dlg, Filename *fn);
+void dlg_filesel_set(union control *ctrl, void *dlg, Filename *fn);
+Filename *dlg_filesel_get(union control *ctrl, void *dlg);
 void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec *fn);
 FontSpec *dlg_fontsel_get(union control *ctrl, void *dlg);
 /*