Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-gtk-3.22/gui_stuff.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
gui_stuff.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__GUI_STUFF_H
14#define FC__GUI_STUFF_H
15
16#include <gtk/gtk.h>
17
18/* utility */
19#include "shared.h"
20
21GtkWidget *icon_label_button_new(const gchar *icon_name,
22 const gchar *label_text);
23void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text);
24void gtk_expose_now(GtkWidget *w);
25void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int py);
26
27void intl_slist(int n, const char **s, bool *done);
28
29/* the standard GTK+ 2.0 API is braindamaged. this is slightly better! */
30
31typedef struct
32{
33 GtkTreeModel *model;
34 gboolean end;
35 GtkTreeIter it;
36} ITree;
37
38#define TREE_ITER_PTR(x) (&(x).it)
39
40void itree_begin(GtkTreeModel *model, ITree *it);
41gboolean itree_end(ITree *it);
42void itree_next(ITree *it);
43void itree_get(ITree *it, ...);
44void itree_set(ITree *it, ...);
45
46void tstore_append(GtkTreeStore *store, ITree *it, ITree *parent);
47
48gboolean itree_is_selected(GtkTreeSelection *selection, ITree *it);
49void itree_select(GtkTreeSelection *selection, ITree *it);
50void itree_unselect(GtkTreeSelection *selection, ITree *it);
51
52gint gtk_tree_selection_get_row(GtkTreeSelection *selection);
53void gtk_tree_view_focus(GtkTreeView *view);
54void setup_dialog(GtkWidget *shell, GtkWidget *parent);
55GtkTreeViewColumn *add_treeview_column(GtkWidget *view, const char *title,
56 GType gtype, int model_index);
57
58GtkWidget *gtk_aux_menu_bar_new(void);
59
60 enum gui_dialog_type {
61 GUI_DIALOG_WINDOW,
62 GUI_DIALOG_TAB
63};
64
65struct gui_dialog;
66
67 typedef void (*GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int, gpointer);
68
69struct gui_dialog
70{
71 /* public. */
72 GtkWidget *vbox;
73 GtkWidget *action_area;
74
75 /* private. */
76 char *title;
77 enum gui_dialog_type type;
78 int id;
79 int return_dialog_id;
80
81 int default_width;
82 int default_height;
83
84 union {
85 GtkWidget *window;
86 struct {
87 GtkWidget *label;
88 GtkWidget *notebook;
89 gulong handler_id;
90 GtkWidget *child;
91 } tab;
92 } v;
93
94 struct gui_dialog **source;
95
96 GUI_DIALOG_RESPONSE_FUN response_callback;
97 gpointer user_data;
98
99 GtkSizeGroup *gui_button;
100};
101
102void dlg_tab_provider_prepare(void);
103
104void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook,
105 gpointer user_data, bool check_top);
106void gui_dialog_set_default_response(struct gui_dialog *dlg, int response);
107GtkWidget *gui_dialog_add_button(struct gui_dialog *dlg,
108 const char *icon_name,
109 const char *text, int response);
110GtkWidget *gui_dialog_add_widget(struct gui_dialog *dlg,
111 GtkWidget *widget);
112void gui_dialog_set_default_size(struct gui_dialog *dlg,
113 int width, int height);
114void gui_dialog_set_title(struct gui_dialog *dlg, const char *title);
115void gui_dialog_set_response_sensitive(struct gui_dialog *dlg,
116 int response, bool setting);
117void gui_dialog_show_all(struct gui_dialog *dlg);
118void gui_dialog_present(struct gui_dialog *dlg);
119void gui_dialog_raise(struct gui_dialog *dlg);
120void gui_dialog_alert(struct gui_dialog *dlg);
121void gui_dialog_destroy(struct gui_dialog *dlg);
122void gui_dialog_destroy_all(void);
123GtkWidget *gui_dialog_get_toplevel(struct gui_dialog *dlg);
124void gui_dialog_response_set_callback(struct gui_dialog *dlg,
125 GUI_DIALOG_RESPONSE_FUN fun);
126void gui_dialog_set_return_dialog(struct gui_dialog *dlg,
127 struct gui_dialog *return_dialog);
128
129void gui_update_font_full(const char *font_name, const char *font_value,
130 PangoFontDescription **font_desc);
131
132void disable_gobject_callback(GObject *obj, GCallback cb);
133void enable_gobject_callback(GObject *obj, GCallback cb);
134
135#endif /* FC__GUI_STUFF_H */
n
#define n
Definition astring.c:77
height
struct canvas int int struct sprite int int int int height
Definition canvas_g.h:44
width
struct canvas int int struct sprite int int int width
Definition canvas_g.h:44
gtk_tree_view_focus
void gtk_tree_view_focus(GtkTreeView *view)
Definition gui_stuff.c:230
gui_dialog_destroy
void gui_dialog_destroy(struct gui_dialog *dlg)
Definition gui_stuff.c:951
gui_dialog_present
void gui_dialog_present(struct gui_dialog *dlg)
Definition gui_stuff.c:834
gtk_stockbutton_set_label
void gtk_stockbutton_set_label(GtkWidget *button, const gchar *label_text)
Definition gui_stuff.c:90
gui_dialog_set_default_response
void gui_dialog_set_default_response(struct gui_dialog *dlg, int response)
Definition gui_stuff.c:733
itree_get
void itree_get(ITree *it,...)
Definition gui_stuff.c:158
itree_set
void itree_set(ITree *it,...)
Definition gui_stuff.c:146
gui_dialog_raise
void gui_dialog_raise(struct gui_dialog *dlg)
Definition gui_stuff.c:864
gui_dialog_new
void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gpointer user_data, bool check_top)
Definition gui_stuff.c:504
disable_gobject_callback
void disable_gobject_callback(GObject *obj, GCallback cb)
Definition gui_stuff.c:1087
gui_dialog_add_widget
GtkWidget * gui_dialog_add_widget(struct gui_dialog *dlg, GtkWidget *widget)
Definition gui_stuff.c:721
gtk_tree_selection_get_row
gint gtk_tree_selection_get_row(GtkTreeSelection *selection)
Definition gui_stuff.c:209
gui_dialog_set_return_dialog
void gui_dialog_set_return_dialog(struct gui_dialog *dlg, struct gui_dialog *return_dialog)
Definition gui_stuff.c:994
gui_dialog_type
gui_dialog_type
Definition gui_stuff.h:59
GUI_DIALOG_WINDOW
@ GUI_DIALOG_WINDOW
Definition gui_stuff.h:60
GUI_DIALOG_TAB
@ GUI_DIALOG_TAB
Definition gui_stuff.h:61
set_relative_window_position
void set_relative_window_position(GtkWindow *ref, GtkWindow *w, int px, int py)
Definition gui_stuff.c:58
gui_dialog_response_set_callback
void gui_dialog_response_set_callback(struct gui_dialog *dlg, GUI_DIALOG_RESPONSE_FUN fun)
Definition gui_stuff.c:985
itree_begin
void itree_begin(GtkTreeModel *model, ITree *it)
Definition gui_stuff.c:121
gui_dialog_add_button
GtkWidget * gui_dialog_add_button(struct gui_dialog *dlg, const char *text, int response)
Definition gui_stuff.c:706
itree_unselect
void itree_unselect(GtkTreeSelection *selection, ITree *it)
Definition gui_stuff.c:200
enable_gobject_callback
void enable_gobject_callback(GObject *obj, GCallback cb)
Definition gui_stuff.c:1103
GUI_DIALOG_RESPONSE_FUN
void(* GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int, gpointer)
Definition gui_stuff.h:66
gui_dialog_show_all
void gui_dialog_show_all(struct gui_dialog *dlg)
Definition gui_stuff.c:794
itree_select
void itree_select(GtkTreeSelection *selection, ITree *it)
Definition gui_stuff.c:192
gui_dialog_set_title
void gui_dialog_set_title(struct gui_dialog *dlg, const char *title)
Definition gui_stuff.c:932
gui_dialog_set_default_size
void gui_dialog_set_default_size(struct gui_dialog *dlg, int width, int height)
Definition gui_stuff.c:916
gui_dialog_alert
void gui_dialog_alert(struct gui_dialog *dlg)
Definition gui_stuff.c:887
add_treeview_column
GtkTreeViewColumn * add_treeview_column(GtkWidget *view, const char *title, GType gtype, int model_index)
Definition gui_stuff.c:1120
tstore_append
void tstore_append(GtkTreeStore *store, ITree *it, ITree *parent)
Definition gui_stuff.c:170
itree_next
void itree_next(ITree *it)
Definition gui_stuff.c:138
gui_dialog_destroy_all
void gui_dialog_destroy_all(void)
Definition gui_stuff.c:971
itree_is_selected
gboolean itree_is_selected(GtkTreeSelection *selection, ITree *it)
Definition gui_stuff.c:184
gtk_aux_menu_bar_new
GtkWidget * gtk_aux_menu_bar_new(void)
Definition gui_stuff.c:249
setup_dialog
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:281
gui_update_font_full
void gui_update_font_full(const char *font_name, const char *font_value, PangoFontDescription **font_desc)
Definition gui_stuff.c:1070
gtk_expose_now
void gtk_expose_now(GtkWidget *w)
Definition gui_stuff.c:50
gui_dialog_set_response_sensitive
void gui_dialog_set_response_sensitive(struct gui_dialog *dlg, int response, bool setting)
Definition gui_stuff.c:759
gui_dialog_get_toplevel
GtkWidget * gui_dialog_get_toplevel(struct gui_dialog *dlg)
Definition gui_stuff.c:786
intl_slist
void intl_slist(int n, const char **s, bool *done)
Definition gui_stuff.c:105
itree_end
gboolean itree_end(ITree *it)
Definition gui_stuff.c:130
shell
static struct gui_dialog * shell
Definition messagedlg.c:39
title
const char * title
Definition repodlgs.c:1313
dlg_tab_provider_prepare
void dlg_tab_provider_prepare(void)
Definition gui_stuff.c:1151
icon_label_button_new
GtkWidget * icon_label_button_new(const gchar *icon_name, const gchar *label_text)
Definition gui_stuff.c:76
GUI_DIALOG_RESPONSE_FUN
void(* GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int, gpointer)
Definition gui_stuff.h:66
font_name
const char * font_name
Definition gui_main_g.h:43
shared.h
ITree
Definition gui_stuff.h:31
gui_dialog
Definition gui_stuff.h:69
gui_dialog::title
char * title
Definition gui_stuff.h:75
gui_dialog::handler_id
gulong handler_id
Definition gui_stuff.h:88
gui_dialog::id
int id
Definition gui_stuff.h:77
gui_dialog::action_area
GtkWidget * action_area
Definition gui_stuff.h:72
gui_dialog::v
union gui_dialog::@149 v
gui_dialog::gui_button
GtkSizeGroup * gui_button
Definition gui_stuff.h:98
gui_dialog::vbox
GtkWidget * vbox
Definition gui_stuff.h:71
gui_dialog::response_callback
GUI_DIALOG_RESPONSE_FUN response_callback
Definition gui_stuff.h:95
gui_dialog::label
GtkWidget * label
Definition gui_stuff.h:86
gui_dialog::tab
struct gui_dialog::@149::@150 tab
gui_dialog::notebook
GtkWidget * notebook
Definition gui_stuff.h:87
gui_dialog::return_dialog_id
int return_dialog_id
Definition gui_stuff.h:78
gui_dialog::default_height
int default_height
Definition gui_stuff.h:81
gui_dialog::source
struct gui_dialog ** source
Definition gui_stuff.h:93
gui_dialog::user_data
gpointer user_data
Definition gui_stuff.h:96
gui_dialog::window
GtkWidget * window
Definition gui_stuff.h:84
gui_dialog::type
enum gui_dialog_type type
Definition gui_stuff.h:76
gui_dialog::default_width
int default_width
Definition gui_stuff.h:80
gui_dialog::child
GtkWidget * child
Definition gui_stuff.h:89
setting
Definition settings.c:88
view
Definition mapview_common.h:36
widget
Definition widget.h:112