コード例 #1
0
ファイル: kamera.cpp プロジェクト: serghei/kde3-kdegraphics
KKameraConfig::KKameraConfig(QWidget *parent, const char *name, const QStringList &)
	: KCModule(KKameraConfigFactory::instance(), parent, name)
{
	m_devicePopup = new KPopupMenu(this);
	m_actions = new KActionCollection(this);
	m_config = new KSimpleConfig(KProtocolInfo::config("camera"));
	
	m_context = gp_context_new();
	if (m_context) {

		// Register the callback functions
		gp_context_set_cancel_func(m_context, cbGPCancel, this);
		gp_context_set_idle_func(m_context, cbGPIdle, this);

		displayGPSuccessDialogue();

		// load existing configuration
		load();

	} else {

		displayGPFailureDialogue();
	}

	// store instance for frontend_prompt
	m_instance = this;
}
コード例 #2
0
ファイル: gpcamera.cpp プロジェクト: Match-Yang/digikam
    GPStatus()
    {
#ifdef HAVE_GPHOTO2
        context = gp_context_new();
        cancel  = false;
        gp_context_set_cancel_func(context, cancel_func, 0);
#ifdef GPHOTO2_DEBUG
        gp_context_set_progress_funcs(context, start_func, update_func, stop_func, 0);
        gp_context_set_error_func(context, error_func, 0);
        gp_context_set_status_func(context, status_func, 0);
#endif /* GPHOTO2_DEBUG */
#endif /* HAVE_GPHOTO2 */
    }
コード例 #3
0
ファイル: gp-params.c プロジェクト: rajbot/gphoto
void
gp_params_init (GPParams *p, char **envp)
{
	if (!p)
		return;

	memset (p, 0, sizeof (GPParams));

	p->folder = strdup ("/");
	if (!p->folder) {
		fprintf (stderr, _("Not enough memory."));
		fputc ('\n', stderr);
		exit (1);
	}

	gp_camera_new (&p->camera);

	p->cols = 79;
	p->flags = FLAGS_RECURSE;

	/* Create a context. Report progress only if users will see it. */
	p->context = gp_context_new ();
	gp_context_set_cancel_func    (p->context, ctx_cancel_func,  p);
	gp_context_set_error_func     (p->context, ctx_error_func,   p);
	gp_context_set_status_func    (p->context, ctx_status_func,  p);
	gp_context_set_message_func   (p->context, ctx_message_func, p);
	if (isatty (STDOUT_FILENO))
		gp_context_set_progress_funcs (p->context,
			ctx_progress_start_func, ctx_progress_update_func,
			ctx_progress_stop_func, p);

	p->_abilities_list = NULL;

	p->debug_func_id = -1;

	p->envp = envp;
}