/usr/include/d/gtkd-3/gio/IOSchedulerJob.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD 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 gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module gio.IOSchedulerJob;
private import gio.Cancellable;
private import gio.c.functions;
public import gio.c.types;
public import gtkc.giotypes;
/**
* Opaque class for defining and scheduling IO jobs.
*/
public class IOSchedulerJob
{
/** the main Gtk struct */
protected GIOSchedulerJob* gIOSchedulerJob;
protected bool ownedRef;
/** Get the main Gtk struct */
public GIOSchedulerJob* getIOSchedulerJobStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gIOSchedulerJob;
}
/** the main Gtk struct as a void* */
protected void* getStruct()
{
return cast(void*)gIOSchedulerJob;
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GIOSchedulerJob* gIOSchedulerJob, bool ownedRef = false)
{
this.gIOSchedulerJob = gIOSchedulerJob;
this.ownedRef = ownedRef;
}
/**
* Used from an I/O job to send a callback to be run in the thread
* that the job was started from, waiting for the result (and thus
* blocking the I/O job).
*
* Deprecated: Use g_main_context_invoke().
*
* Params:
* func = a #GSourceFunc callback that will be called in the original thread
* userData = data to pass to @func
* notify = a #GDestroyNotify for @user_data, or %NULL
*
* Returns: The return value of @func
*/
public bool sendToMainloop(GSourceFunc func, void* userData, GDestroyNotify notify)
{
return g_io_scheduler_job_send_to_mainloop(gIOSchedulerJob, func, userData, notify) != 0;
}
/**
* Used from an I/O job to send a callback to be run asynchronously in
* the thread that the job was started from. The callback will be run
* when the main loop is available, but at that time the I/O job might
* have finished. The return value from the callback is ignored.
*
* Note that if you are passing the @user_data from g_io_scheduler_push_job()
* on to this function you have to ensure that it is not freed before
* @func is called, either by passing %NULL as @notify to
* g_io_scheduler_push_job() or by using refcounting for @user_data.
*
* Deprecated: Use g_main_context_invoke().
*
* Params:
* func = a #GSourceFunc callback that will be called in the original thread
* userData = data to pass to @func
* notify = a #GDestroyNotify for @user_data, or %NULL
*/
public void sendToMainloopAsync(GSourceFunc func, void* userData, GDestroyNotify notify)
{
g_io_scheduler_job_send_to_mainloop_async(gIOSchedulerJob, func, userData, notify);
}
/**
* Cancels all cancellable I/O jobs.
*
* A job is cancellable if a #GCancellable was passed into
* g_io_scheduler_push_job().
*
* Deprecated: You should never call this function, since you don't
* know how other libraries in your program might be making use of
* gioscheduler.
*/
public static void cancelAllJobs()
{
g_io_scheduler_cancel_all_jobs();
}
/**
* Schedules the I/O job to run in another thread.
*
* @notify will be called on @user_data after @job_func has returned,
* regardless whether the job was cancelled or has run to completion.
*
* If @cancellable is not %NULL, it can be used to cancel the I/O job
* by calling g_cancellable_cancel() or by calling
* g_io_scheduler_cancel_all_jobs().
*
* Deprecated: use #GThreadPool or g_task_run_in_thread()
*
* Params:
* jobFunc = a #GIOSchedulerJobFunc.
* userData = data to pass to @job_func
* notify = a #GDestroyNotify for @user_data, or %NULL
* ioPriority = the [I/O priority][io-priority]
* of the request.
* cancellable = optional #GCancellable object, %NULL to ignore.
*/
public static void pushJob(GIOSchedulerJobFunc jobFunc, void* userData, GDestroyNotify notify, int ioPriority, Cancellable cancellable)
{
g_io_scheduler_push_job(jobFunc, userData, notify, ioPriority, (cancellable is null) ? null : cancellable.getCancellableStruct());
}
}
|