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 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512
|
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.
namespace GLib {
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
#region Autogenerated code
public partial class DateTime : GLib.Opaque {
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_get_type();
public static GLib.GType GType {
get {
IntPtr raw_ret = g_date_time_get_type();
GLib.GType ret = new GLib.GType(raw_ret);
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add(IntPtr raw, long timespan);
public GLib.DateTime Add(long timespan) {
IntPtr raw_ret = g_date_time_add(Handle, timespan);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_days(IntPtr raw, int days);
public GLib.DateTime AddDays(int days) {
IntPtr raw_ret = g_date_time_add_days(Handle, days);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_full(IntPtr raw, int years, int months, int days, int hours, int minutes, double seconds);
public GLib.DateTime AddFull(int years, int months, int days, int hours, int minutes, double seconds) {
IntPtr raw_ret = g_date_time_add_full(Handle, years, months, days, hours, minutes, seconds);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_hours(IntPtr raw, int hours);
public GLib.DateTime AddHours(int hours) {
IntPtr raw_ret = g_date_time_add_hours(Handle, hours);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_minutes(IntPtr raw, int minutes);
public GLib.DateTime AddMinutes(int minutes) {
IntPtr raw_ret = g_date_time_add_minutes(Handle, minutes);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_months(IntPtr raw, int months);
public GLib.DateTime AddMonths(int months) {
IntPtr raw_ret = g_date_time_add_months(Handle, months);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_seconds(IntPtr raw, double seconds);
public GLib.DateTime AddSeconds(double seconds) {
IntPtr raw_ret = g_date_time_add_seconds(Handle, seconds);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_weeks(IntPtr raw, int weeks);
public GLib.DateTime AddWeeks(int weeks) {
IntPtr raw_ret = g_date_time_add_weeks(Handle, weeks);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_add_years(IntPtr raw, int years);
public GLib.DateTime AddYears(int years) {
IntPtr raw_ret = g_date_time_add_years(Handle, years);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern long g_date_time_difference(IntPtr raw, IntPtr begin);
public long Difference(GLib.DateTime begin) {
long raw_ret = g_date_time_difference(Handle, begin == null ? IntPtr.Zero : begin.Handle);
long ret = raw_ret;
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_format(IntPtr raw, IntPtr format);
public string Format(string format) {
IntPtr native_format = GLib.Marshaller.StringToPtrGStrdup (format);
IntPtr raw_ret = g_date_time_format(Handle, native_format);
string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
GLib.Marshaller.Free (native_format);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_day_of_month(IntPtr raw);
public int DayOfMonth {
get {
int raw_ret = g_date_time_get_day_of_month(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_day_of_week(IntPtr raw);
public int DayOfWeek {
get {
int raw_ret = g_date_time_get_day_of_week(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_day_of_year(IntPtr raw);
public int DayOfYear {
get {
int raw_ret = g_date_time_get_day_of_year(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_hour(IntPtr raw);
public int Hour {
get {
int raw_ret = g_date_time_get_hour(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_microsecond(IntPtr raw);
public int Microsecond {
get {
int raw_ret = g_date_time_get_microsecond(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_minute(IntPtr raw);
public int Minute {
get {
int raw_ret = g_date_time_get_minute(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_month(IntPtr raw);
public int Month {
get {
int raw_ret = g_date_time_get_month(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_second(IntPtr raw);
public int Second {
get {
int raw_ret = g_date_time_get_second(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern double g_date_time_get_seconds(IntPtr raw);
public double Seconds {
get {
double raw_ret = g_date_time_get_seconds(Handle);
double ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_get_timezone_abbreviation(IntPtr raw);
public string TimezoneAbbreviation {
get {
IntPtr raw_ret = g_date_time_get_timezone_abbreviation(Handle);
string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern long g_date_time_get_utc_offset(IntPtr raw);
public long UtcOffset {
get {
long raw_ret = g_date_time_get_utc_offset(Handle);
long ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_week_numbering_year(IntPtr raw);
public int WeekNumberingYear {
get {
int raw_ret = g_date_time_get_week_numbering_year(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_week_of_year(IntPtr raw);
public int WeekOfYear {
get {
int raw_ret = g_date_time_get_week_of_year(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_get_year(IntPtr raw);
public int Year {
get {
int raw_ret = g_date_time_get_year(Handle);
int ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern void g_date_time_get_ymd(IntPtr raw, out int year, out int month, out int day);
public void GetYmd(out int year, out int month, out int day) {
g_date_time_get_ymd(Handle, out year, out month, out day);
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern bool g_date_time_is_daylight_savings(IntPtr raw);
public bool IsDaylightSavings {
get {
bool raw_ret = g_date_time_is_daylight_savings(Handle);
bool ret = raw_ret;
return ret;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_to_local(IntPtr raw);
public GLib.DateTime ToLocal() {
IntPtr raw_ret = g_date_time_to_local(Handle);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern bool g_date_time_to_timeval(IntPtr raw, IntPtr tv);
public bool ToTimeval(GLib.TimeVal tv) {
IntPtr native_tv = GLib.Marshaller.StructureToPtrAlloc (tv);
bool raw_ret = g_date_time_to_timeval(Handle, native_tv);
bool ret = raw_ret;
tv = GLib.TimeVal.New (native_tv);
Marshal.FreeHGlobal (native_tv);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_to_timezone(IntPtr raw, IntPtr tz);
public GLib.DateTime ToTimezone(GLib.TimeZone tz) {
IntPtr raw_ret = g_date_time_to_timezone(Handle, tz == null ? IntPtr.Zero : tz.Handle);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern long g_date_time_to_unix(IntPtr raw);
public long ToUnix() {
long raw_ret = g_date_time_to_unix(Handle);
long ret = raw_ret;
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_to_utc(IntPtr raw);
public GLib.DateTime ToUtc() {
IntPtr raw_ret = g_date_time_to_utc(Handle);
GLib.DateTime ret = raw_ret == IntPtr.Zero ? null : (GLib.DateTime) GLib.Opaque.GetOpaque (raw_ret, typeof (GLib.DateTime), true);
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern int g_date_time_compare(IntPtr dt1, IntPtr dt2);
public static int Compare(IntPtr dt1, IntPtr dt2) {
int raw_ret = g_date_time_compare(dt1, dt2);
int ret = raw_ret;
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern bool g_date_time_equal(IntPtr dt1, IntPtr dt2);
public static bool Equal(IntPtr dt1, IntPtr dt2) {
bool raw_ret = g_date_time_equal(dt1, dt2);
bool ret = raw_ret;
return ret;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern uint g_date_time_hash(IntPtr datetime);
public static uint Hash(IntPtr datetime) {
uint raw_ret = g_date_time_hash(datetime);
uint ret = raw_ret;
return ret;
}
public DateTime(IntPtr raw) : base(raw) {}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new(IntPtr tz, int year, int month, int day, int hour, int minute, double seconds);
public DateTime (GLib.TimeZone tz, int year, int month, int day, int hour, int minute, double seconds)
{
Raw = g_date_time_new(tz == null ? IntPtr.Zero : tz.Handle, year, month, day, hour, minute, seconds);
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_from_timeval_local(IntPtr tv);
public DateTime (GLib.TimeVal tv)
{
IntPtr native_tv = GLib.Marshaller.StructureToPtrAlloc (tv);
Raw = g_date_time_new_from_timeval_local(native_tv);
tv = GLib.TimeVal.New (native_tv);
Marshal.FreeHGlobal (native_tv);
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_from_timeval_utc(IntPtr tv);
public static DateTime NewFromTimevalUtc(GLib.TimeVal tv)
{
IntPtr native_tv = GLib.Marshaller.StructureToPtrAlloc (tv);
DateTime result = new DateTime (g_date_time_new_from_timeval_utc(native_tv));
tv = GLib.TimeVal.New (native_tv);
Marshal.FreeHGlobal (native_tv);
return result;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_from_unix_local(long t);
public DateTime (long t)
{
Raw = g_date_time_new_from_unix_local(t);
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_from_unix_utc(long t);
public static DateTime NewFromUnixUtc(long t)
{
DateTime result = new DateTime (g_date_time_new_from_unix_utc(t));
return result;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_local(int year, int month, int day, int hour, int minute, double seconds);
public DateTime (int year, int month, int day, int hour, int minute, double seconds)
{
Raw = g_date_time_new_local(year, month, day, hour, minute, seconds);
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_now(IntPtr tz);
public DateTime (GLib.TimeZone tz)
{
Raw = g_date_time_new_now(tz == null ? IntPtr.Zero : tz.Handle);
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_now_local();
public DateTime ()
{
Raw = g_date_time_new_now_local();
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_now_utc();
public static DateTime NewNowUtc()
{
DateTime result = new DateTime (g_date_time_new_now_utc());
return result;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_new_utc(int year, int month, int day, int hour, int minute, double seconds);
public static DateTime NewUtc(int year, int month, int day, int hour, int minute, double seconds)
{
DateTime result = new DateTime (g_date_time_new_utc(year, month, day, hour, minute, seconds));
return result;
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr g_date_time_ref(IntPtr raw);
protected override void Ref (IntPtr raw)
{
if (!Owned) {
g_date_time_ref (raw);
Owned = true;
}
}
[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
static extern void g_date_time_unref(IntPtr raw);
protected override void Unref (IntPtr raw)
{
if (Owned) {
g_date_time_unref (raw);
Owned = false;
}
}
class FinalizerInfo {
IntPtr handle;
public FinalizerInfo (IntPtr handle)
{
this.handle = handle;
}
public bool Handler ()
{
g_date_time_unref (handle);
return false;
}
}
~DateTime ()
{
if (!Owned)
return;
FinalizerInfo info = new FinalizerInfo (Handle);
GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));
}
#endregion
}
}
|