pidgin/gtk3compat.h

changeset 36243
2a390d401448
parent 35953
e140cb62e5f2
child 36244
2a4179d0177d
equal deleted inserted replaced
36242:dadd62632e4a 36243:2a390d401448
75 GTK_COLOR_SELECTION(colorsel), color); 75 GTK_COLOR_SELECTION(colorsel), color);
76 } else 76 } else
77 gtk_color_button_get_color(GTK_COLOR_BUTTON(widget), color); 77 gtk_color_button_get_color(GTK_COLOR_BUTTON(widget), color);
78 } 78 }
79 79
80 #else 80 #else /* 3.4.0 */
81 81
82 static inline void 82 static inline void
83 pidgin_color_chooser_set_rgb(GtkColorChooser *chooser, const GdkColor *rgb) 83 pidgin_color_chooser_set_rgb(GtkColorChooser *chooser, const GdkColor *rgb)
84 { 84 {
85 GdkRGBA rgba; 85 GdkRGBA rgba;
102 rgb->green = (int)round(rgba.green * 65535.0); 102 rgb->green = (int)round(rgba.green * 65535.0);
103 rgb->blue = (int)round(rgba.blue * 65535.0); 103 rgb->blue = (int)round(rgba.blue * 65535.0);
104 } 104 }
105 105
106 #endif /* 3.4.0 and gtk_color_chooser_ */ 106 #endif /* 3.4.0 and gtk_color_chooser_ */
107
108
109 #if GTK_CHECK_VERSION(3,0,0)
110
111 static inline GtkWidget *
112 gtk_grid_table_new(guint rows, guint columns)
113 {
114 return gtk_grid_new();
115 }
116
117 static inline void
118 gtk_grid_attach_defaults(GtkGrid *grid, GtkWidget *child, gint left, gint top,
119 gint width, gint height)
120 {
121 gtk_grid_attach(grid, child, left, top, width, height);
122 gtk_widget_set_hexpand(child, TRUE);
123 gtk_widget_set_vexpand(child, TRUE);
124 }
125
126 #else /* 3.0.0 and gtk_grid_ */
127
128 #define GTK_GRID GTK_TABLE
129 #define GtkGrid GtkTable
130
131 static inline GtkWidget *
132 gtk_grid_table_new(guint rows, guint columns)
133 {
134 return gtk_table_new(rows, columns, FALSE);
135 }
136
137 static inline void
138 gtk_grid_set_row_spacing(GtkGrid *grid, guint spacing)
139 {
140 gtk_table_set_row_spacings(grid, spacing);
141 }
142
143 static inline void
144 gtk_grid_set_column_spacing(GtkGrid *grid, guint spacing)
145 {
146 gtk_table_set_col_spacings(grid, spacing);
147 }
148
149 static inline void
150 gtk_grid_attach_defaults(GtkGrid *grid, GtkWidget *child, gint left, gint top,
151 gint width, gint height)
152 {
153 gtk_table_attach_defaults(grid, child, left, left + width,
154 top, top + height);
155 }
156
157 #endif /* 3.0.0 and gtk_grid_ */
107 158
108 159
109 #if !GTK_CHECK_VERSION(3,2,0) 160 #if !GTK_CHECK_VERSION(3,2,0)
110 161
111 #define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG 162 #define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG

mercurial