gui.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*
  2. * gui.h
  3. *
  4. * $Id$
  5. *
  6. * The iODBC driver manager.
  7. *
  8. * Copyright (C) 1996-2021 OpenLink Software <[email protected]>
  9. * All Rights Reserved.
  10. *
  11. * This software is released under the terms of either of the following
  12. * licenses:
  13. *
  14. * - GNU Library General Public License (see LICENSE.LGPL)
  15. * - The BSD License (see LICENSE.BSD).
  16. *
  17. * Note that the only valid version of the LGPL license as far as this
  18. * project is concerned is the original GNU Library General Public License
  19. * Version 2, dated June 1991.
  20. *
  21. * While not mandated by the BSD license, any patches you make to the
  22. * iODBC source code may be contributed back into the iODBC project
  23. * at your discretion. Contributions will benefit the Open Source and
  24. * Data Access community as a whole. Submissions may be made at:
  25. *
  26. * http://www.iodbc.org
  27. *
  28. *
  29. * GNU Library Generic Public License Version 2
  30. * ============================================
  31. * This library is free software; you can redistribute it and/or
  32. * modify it under the terms of the GNU Library General Public
  33. * License as published by the Free Software Foundation; only
  34. * Version 2 of the License dated June 1991.
  35. *
  36. * This library is distributed in the hope that it will be useful,
  37. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  38. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  39. * Library General Public License for more details.
  40. *
  41. * You should have received a copy of the GNU Library General Public
  42. * License along with this library; if not, write to the Free
  43. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  44. *
  45. *
  46. * The BSD License
  47. * ===============
  48. * Redistribution and use in source and binary forms, with or without
  49. * modification, are permitted provided that the following conditions
  50. * are met:
  51. *
  52. * 1. Redistributions of source code must retain the above copyright
  53. * notice, this list of conditions and the following disclaimer.
  54. * 2. Redistributions in binary form must reproduce the above copyright
  55. * notice, this list of conditions and the following disclaimer in
  56. * the documentation and/or other materials provided with the
  57. * distribution.
  58. * 3. Neither the name of OpenLink Software Inc. nor the names of its
  59. * contributors may be used to endorse or promote products derived
  60. * from this software without specific prior written permission.
  61. *
  62. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  63. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  64. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  65. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
  66. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  67. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  68. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  69. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  70. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  71. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  72. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  73. */
  74. #include <iodbc.h>
  75. #include <odbcinst.h>
  76. #include <gtk/gtk.h>
  77. #include <unicode.h>
  78. #ifndef _GTKGUI_H
  79. #define _GTKGUI_H
  80. #define GLADE_HOOKUP_OBJECT(component,widget,name) \
  81. gtk_widget_ref(widget); \
  82. gtk_object_set_data_full (GTK_OBJECT (component), name, \
  83. widget, (GtkDestroyNotify) gtk_widget_unref)
  84. #define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
  85. gtk_object_set_data (GTK_OBJECT (component), name, widget)
  86. #define _(X) X
  87. extern char* szDSNColumnNames[];
  88. extern char* szTabNames[];
  89. extern char* szDSNButtons[];
  90. extern char* szDriverColumnNames[];
  91. typedef struct TFILEDSN
  92. {
  93. GtkWidget *name_entry, *mainwnd;
  94. char *name;
  95. } TFILEDSN;
  96. typedef struct TDSNCHOOSER
  97. {
  98. GtkWidget *mainwnd, *udsnlist, *sdsnlist;
  99. GtkWidget *uadd, *uremove, *utest, *uconfigure;
  100. GtkWidget *sadd, *sremove, *stest, *sconfigure;
  101. GtkWidget *fadd, *fremove, *ftest, *fconfigure, *fsetdir;
  102. GtkWidget *dir_list, *file_list, *file_entry, *dir_combo;
  103. wchar_t *dsn;
  104. wchar_t *fdsn;
  105. char curr_dir[1024];
  106. int type_dsn;
  107. } TDSNCHOOSER;
  108. typedef struct TDRIVERCHOOSER
  109. {
  110. GtkWidget *driverlist, *mainwnd, *b_add, *b_remove, *b_configure, *b_finish;
  111. wchar_t *driver;
  112. } TDRIVERCHOOSER;
  113. typedef struct TFDRIVERCHOOSER
  114. {
  115. GtkWidget *driverlist, *mainwnd;
  116. GtkWidget *dsn_entry, *b_back, *b_continue;
  117. GtkWidget *mess_entry, *tab_panel, *browse_sel;
  118. char *curr_dir;
  119. char *attrs;
  120. char *dsn;
  121. BOOL verify_conn;
  122. wchar_t *driver;
  123. BOOL ok;
  124. } TFDRIVERCHOOSER;
  125. typedef struct TCONNECTIONPOOLING
  126. {
  127. GtkWidget *driverlist, *mainwnd, *enperfmon_rb, *disperfmon_rb,
  128. *retwait_entry, *timeout_entry, *probe_entry;
  129. BOOL changed;
  130. char timeout[64];
  131. char probe[512];
  132. char driver[1024];
  133. } TCONNECTIONPOOLING;
  134. typedef struct TTRANSLATORCHOOSER
  135. {
  136. GtkWidget *translatorlist, *mainwnd, *b_finish;
  137. wchar_t *translator;
  138. } TTRANSLATORCHOOSER;
  139. typedef struct TCOMPONENT
  140. {
  141. GtkWidget *componentlist;
  142. } TCOMPONENT;
  143. typedef struct TTRACING
  144. {
  145. GtkWidget *logfile_entry, *tracelib_entry, *b_start_stop;
  146. GtkWidget *donttrace_rb, *allthetime_rb, *onetime_rb;
  147. GtkWidget *filesel;
  148. BOOL changed;
  149. } TTRACING;
  150. typedef struct TCONFIRM
  151. {
  152. GtkWidget *mainwnd;
  153. BOOL yes_no;
  154. } TCONFIRM;
  155. typedef struct TDRIVERSETUP
  156. {
  157. GtkWidget *name_entry, *driver_entry, *setup_entry, *key_list, *bupdate;
  158. GtkWidget *key_entry, *value_entry;
  159. GtkWidget *mainwnd, *filesel;
  160. LPSTR connstr;
  161. } TDRIVERSETUP;
  162. typedef struct TGENSETUP
  163. {
  164. GtkWidget *dsn_entry, *key_list, *bupdate;
  165. GtkWidget *key_entry, *value_entry;
  166. GtkWidget *mainwnd;
  167. GtkWidget *verify_conn_cb;
  168. LPSTR connstr;
  169. BOOL verify_conn;
  170. } TGENSETUP;
  171. void adddsns_to_list(GtkWidget* widget, BOOL systemDSN);
  172. void userdsn_add_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  173. void userdsn_remove_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  174. void userdsn_configure_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  175. void userdsn_test_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  176. void systemdsn_add_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  177. void systemdsn_remove_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  178. void systemdsn_configure_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  179. void systemdsn_test_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  180. void filedsn_add_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  181. void filedsn_remove_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  182. void filedsn_configure_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  183. void filedsn_test_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  184. void filedsn_setdir_clicked(GtkWidget* widget, TDSNCHOOSER *choose_t);
  185. void userdsn_list_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  186. void userdsn_list_unselect(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  187. void systemdsn_list_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  188. void systemdsn_list_unselect(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  189. void filedsn_filelist_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  190. void filedsn_filelist_unselect(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  191. void filedsn_dirlist_select(GtkWidget* widget, gint row, gint column, GdkEvent *event, TDSNCHOOSER *choose_t);
  192. void filedsn_lookin_clicked(GtkWidget* widget, void **array);
  193. void adddrivers_to_list(GtkWidget* widget, GtkWidget* dlg);
  194. void addtranslators_to_list(GtkWidget* widget, GtkWidget* dlg);
  195. void adddirectories_to_list(HWND hwnd, GtkWidget* widget, LPCSTR path);
  196. void addfiles_to_list(HWND hwnd, GtkWidget* widget, LPCSTR path);
  197. void addlistofdir_to_optionmenu(GtkWidget* widget, LPCSTR path, TDSNCHOOSER *choose_t);
  198. LPSTR create_keyval (HWND wnd, LPCSTR attrs, BOOL *verify_conn);
  199. LPSTR create_fgensetup (HWND hwnd, LPCSTR dsn, LPCSTR attrs, BOOL add, BOOL *verify_conn);
  200. void create_message (HWND hwnd, LPCSTR dsn, LPCSTR text);
  201. #endif