2 Copyright (c) 2001, Loki software, inc.
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
8 Redistributions of source code must retain the above copyright notice, this list
9 of conditions and the following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this
12 list of conditions and the following disclaimer in the documentation and/or
13 other materials provided with the distribution.
15 Neither the name of Loki software nor the names of its contributors may be used
16 to endorse or promote products derived from this software without specific prior
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
23 DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 void win32_get_window_pos(GtkWidget *widget, gint *x, gint *y);
38 inline void get_window_pos(GtkWidget *wnd, int* x, int* y)
40 win32_get_window_pos(wnd, x, y);
45 inline void get_window_pos(GtkWidget *wnd, int* x, int* y)
47 gdk_window_get_root_origin (wnd->window, x, y);
53 struct window_position_t
58 void save_window_pos (GtkWidget *wnd, window_position_t& pos);
59 void load_window_pos (GtkWidget *wnd, window_position_t& pos);
60 gint widget_delete_hide (GtkWidget *widget);
62 // GdkPixmap **gdkpixmap, GdkBitmap **mask
63 bool WINAPI load_plugin_bitmap (const char* filename, void **gdkpixmap, void **mask);
64 void load_pixmap (const char* filename, GtkWidget* widget, GdkPixmap **gdkpixmap, GdkBitmap **mask);
65 GtkWidget* new_pixmap (GtkWidget* widget, char* filename);
67 GtkWidget* menu_separator (GtkWidget *menu);
68 GtkWidget* menu_tearoff (GtkWidget *menu);
69 GtkWidget* create_sub_menu_with_mnemonic (GtkWidget *bar, char *mnemonic);
70 GtkWidget* create_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id);
71 GtkWidget* create_check_menu_item_with_mnemonic (GtkWidget *menu, gchar *mnemonic, GtkSignalFunc func, int id, gboolean active);
72 GtkWidget* create_radio_menu_item_with_mnemonic (GtkWidget *menu, GtkWidget *last, gchar *mnemonic, GtkSignalFunc func, int id, gboolean state);
73 GtkWidget* create_menu_in_menu_with_mnemonic (GtkWidget *menu, const gchar *mnemonic);
78 do various message boxes, IDOK .. IDNO
79 URL adds an optional 'go to URL' button
81 int WINAPI gtk_MessageBox (void *parent, const char* lpText, const char* lpCaption = "Radiant", guint32 uType = MB_OK, const char* URL = NULL);
82 // NOTE: the returned filename is allocated with g_malloc and MUST be freed with g_free (both for win32 and Gtk dialogs)
84 const char* file_dialog (void *parent, gboolean open, const char* title, const char* path = (char*)NULL, const char* pattern = NULL);
87 \fn dir_dialog, prompts for a directory
89 char* WINAPI dir_dialog (void *parent, const char* title = "Choose Directory", const char* path = (char*)NULL);
91 bool WINAPI color_dialog (void *parent, float *color, const char* title = "Choose Color");
93 void dialog_button_callback (GtkWidget *widget, gpointer data);
94 gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data);
96 void OpenURL(const char *url);
98 void CheckMenuSplitting (GtkWidget *&menu);
100 #endif // _GTK_MISC_H_