1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
|
//
// Gtk.Style.custom - Gtk Style class customizations
//
// Authors: Rachel Hestilow <hestilow@ximian.com>
// Radek Doulik <rodo@matfyz.cz>
// Mike Kestner <mkestner@novell.com>
//
// Copyright (C) 2002, 2003 Rachel Hestilow, Radek Doulik
// Copyright (C) 2005 Novell, Inc.
//
// This code is inserted after the automatically generated code.
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
static Gdk.GC EnsureGC (IntPtr raw) {
if (raw == IntPtr.Zero)
return null;
Gdk.GC ret = (Gdk.GC) GLib.Object.GetObject (raw, false);
if (ret == null)
ret = new Gdk.GC (raw);
return ret;
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_white_gc (IntPtr style);
public Gdk.GC WhiteGC {
get { return EnsureGC (gtksharp_gtk_style_get_white_gc (Handle)); }
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_black_gc (IntPtr style);
public Gdk.GC BlackGC {
get { return EnsureGC (gtksharp_gtk_style_get_black_gc (Handle)); }
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_fg_gc (IntPtr style, int i);
public Gdk.GC ForegroundGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_fg_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_fg_gc (IntPtr style, int i, IntPtr gc);
public void SetForegroundGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_fg_gc (Handle, (int) state, gc.Handle);
}
public Gdk.GC[] ForegroundGCs {
get {
Gdk.GC[] ret = new Gdk.GC[5];
for (int i = 0; i < 5; i++)
ret[i] = EnsureGC (gtksharp_gtk_style_get_fg_gc (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_bg_gc (IntPtr style, int i);
public Gdk.GC BackgroundGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_bg_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_bg_gc (IntPtr style, int i, IntPtr gc);
public void SetBackgroundGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_bg_gc (Handle, (int) state, gc.Handle);
}
public Gdk.GC[] BackgroundGCs {
get {
Gdk.GC[] ret = new Gdk.GC[5];
for (int i = 0; i < 5; i++)
ret[i] = EnsureGC (gtksharp_gtk_style_get_bg_gc (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_base_gc (IntPtr style, int i);
public Gdk.GC BaseGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_base_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_base_gc (IntPtr style, int i, IntPtr gc);
public void SetBaseGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_base_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_text_gc (IntPtr style, int i);
public Gdk.GC TextGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_text_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_text_gc (IntPtr style, int i, IntPtr gc);
public void SetTextGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_text_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_text_aa_gc (IntPtr style, int i);
public Gdk.GC TextAAGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_text_aa_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_text_aa_gc (IntPtr style, int i, IntPtr gc);
public void SetTextAAGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_text_aa_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_light_gc (IntPtr style, int i);
public Gdk.GC LightGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_light_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_light_gc (IntPtr style, int i, IntPtr gc);
public void SetLightGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_light_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_dark_gc (IntPtr style, int i);
public Gdk.GC DarkGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_dark_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_dark_gc (IntPtr style, int i, IntPtr gc);
public void SetDarkGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_dark_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_mid_gc (IntPtr style, int i);
public Gdk.GC MidGC (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_mid_gc (Handle, (int) state);
return EnsureGC (raw);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_set_mid_gc (IntPtr style, int i, IntPtr gc);
public void SetMidGC (StateType state, Gdk.GC gc)
{
gtksharp_gtk_style_set_mid_gc (Handle, (int) state, gc.Handle);
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_white (IntPtr style);
public Gdk.Color White {
get { return Gdk.Color.New (gtksharp_gtk_style_get_white (Handle)); }
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_black (IntPtr style);
public Gdk.Color Black {
get { return Gdk.Color.New (gtksharp_gtk_style_get_black (Handle)); }
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_bg (IntPtr style, int i);
public Gdk.Color Background (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_bg (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] Backgrounds {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_bg (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_fg (IntPtr style, int i);
public Gdk.Color Foreground (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_fg (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] Foregrounds {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_fg (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_text (IntPtr style, int i);
public Gdk.Color Text (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_text (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] TextColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_text (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_base (IntPtr style, int i);
public Gdk.Color Base (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_base (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] BaseColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_base (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_light (IntPtr style, int i);
public Gdk.Color Light (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_light (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] LightColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_light (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_mid (IntPtr style, int i);
public Gdk.Color Mid (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_mid (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] MidColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_mid (Handle, i));
return ret;
}
}
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_dark (IntPtr style, int i);
public Gdk.Color Dark (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_dark (Handle, (int) state);
return Gdk.Color.New (raw);
}
public Gdk.Color[] DarkColors {
get {
Gdk.Color[] ret = new Gdk.Color[5];
for (int i = 0; i < 5; i++)
ret[i] = Gdk.Color.New (gtksharp_gtk_style_get_dark (Handle, i));
return ret;
}
}
[DllImport ("gtksharpglue")]
static extern int gtksharp_gtk_style_get_thickness (IntPtr style, int x_axis);
[DllImport ("gtksharpglue")]
static extern void gtksharp_gtk_style_set_thickness (IntPtr style, int value);
public int XThickness {
get {
return gtksharp_gtk_style_get_thickness (Handle, 0);
}
set {
gtksharp_gtk_style_set_thickness (Handle, value);
}
}
public int YThickness {
get {
return gtksharp_gtk_style_get_thickness (Handle, 1);
}
set {
gtksharp_gtk_style_set_thickness (Handle, -value);
}
}
[DllImport ("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_font_description (IntPtr style);
public Pango.FontDescription FontDescription {
get {
IntPtr Raw = gtksharp_gtk_style_get_font_description (Handle);
if (Raw == IntPtr.Zero)
return null;
Pango.FontDescription ret = (Pango.FontDescription) GLib.Opaque.GetOpaque (Raw);
if (ret == null)
ret = new Pango.FontDescription (Raw);
return ret;
}
}
[DllImport ("gtksharpglue")]
static extern IntPtr gtksharp_gtk_style_get_bg_pixmap (IntPtr style, int state);
[DllImport ("gtksharpglue")]
static extern void gtksharp_gtk_style_set_bg_pixmap (IntPtr style, int state, IntPtr pixmap);
public Gdk.Pixmap BgPixmap (StateType state)
{
IntPtr raw = gtksharp_gtk_style_get_bg_pixmap (Handle, (int) state);
return GLib.Object.GetObject (raw) as Gdk.Pixmap;
}
public Gdk.Pixmap[] BgPixmaps {
get {
Gdk.Pixmap[] ret = new Gdk.Pixmap [5];
for (int i = 0; i < 5; i++)
ret [i] = GLib.Object.GetObject (gtksharp_gtk_style_get_dark (Handle, i)) as Gdk.Pixmap;
return ret;
}
}
public void SetBgPixmap (StateType state, Gdk.Pixmap pixmap)
{
gtksharp_gtk_style_set_bg_pixmap (Handle, (int) state, pixmap == null ? IntPtr.Zero : pixmap.Handle);
}
|