static void
g_local_directory_monitor_class_init (GLocalDirectoryMonitorClass* klass)
{
  GObjectClass* gobject_class = G_OBJECT_CLASS (klass);
  GFileMonitorClass *file_monitor_class = G_FILE_MONITOR_CLASS (klass);
  
  gobject_class->finalize = g_local_directory_monitor_finalize;
  gobject_class->set_property = g_local_directory_monitor_set_property;
  gobject_class->constructor = g_local_directory_monitor_constructor;

  file_monitor_class->cancel = g_local_directory_monitor_cancel;

  g_object_class_install_property (gobject_class, 
                                   PROP_DIRNAME,
                                   g_param_spec_string ("dirname", 
                                                        P_("Directory name"), 
                                                        P_("Directory to monitor"),
                                                        NULL, 
                                                        G_PARAM_CONSTRUCT_ONLY|
                                                        G_PARAM_WRITABLE|
                                                        G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
  g_object_class_install_property (gobject_class,
                                   PROP_FLAGS,
                                   g_param_spec_flags ("flags",
						       P_("Monitor flags"),
						       P_("Monitor flags"),
						       G_TYPE_FILE_MONITOR_FLAGS,
						       0,
						       G_PARAM_CONSTRUCT_ONLY|
						       G_PARAM_WRITABLE|
						       G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));

  klass->mount_notify = FALSE;
}
Esempio n. 2
0
static void fm_dummy_monitor_class_init (FmDummyMonitorClass *klass)
{
    GFileMonitorClass *fm_class = G_FILE_MONITOR_CLASS (klass);
    fm_class->cancel = cancel;
/*
    g_object_class = G_OBJECT_CLASS (klass);
    g_object_class->finalize = fm_dummy_monitor_finalize;
*/
}
Esempio n. 3
0
static gboolean
g_win32_directory_monitor_cancel (GFileMonitor *base)
{
  GWin32DirectoryMonitor *self;
  self = G_WIN32_DIRECTORY_MONITOR (base);

  /* This triggers a last callback() with nBytes==0. */

  /* Actually I am not so sure about that, it seems to trigger a last
   * callback allright, but the way to recognize that it is the final
   * one is not to check for nBytes==0, I think that was a
   * misunderstanding.
   */ 
  if (self->priv->hDirectory != INVALID_HANDLE_VALUE)
    CloseHandle (self->priv->hDirectory);

  if (G_FILE_MONITOR_CLASS (g_win32_directory_monitor_parent_class)->cancel)
    (*G_FILE_MONITOR_CLASS (g_win32_directory_monitor_parent_class)->cancel) (base);
  return TRUE;
}
Esempio n. 4
0
static void 
g_win32_directory_monitor_class_init (GWin32DirectoryMonitorClass *klass)
{
  g_win32_directory_monitor_parent_class = g_type_class_peek_parent (klass);

  G_OBJECT_CLASS (klass)->constructor = g_win32_directory_monitor_constructor;
  G_OBJECT_CLASS (klass)->finalize = g_win32_directory_monitor_finalize;
  G_FILE_MONITOR_CLASS (klass)->cancel = g_win32_directory_monitor_cancel;

  G_LOCAL_DIRECTORY_MONITOR_CLASS (klass)->mount_notify = FALSE;
  G_LOCAL_DIRECTORY_MONITOR_CLASS (klass)->is_supported = g_win32_directory_monitor_is_supported;
}