当前位置: 首页>>代码示例>>C++>>正文


C++ Surface::GetTimeManager方法代码示例

本文整理汇总了C++中Surface::GetTimeManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Surface::GetTimeManager方法的具体用法?C++ Surface::GetTimeManager怎么用?C++ Surface::GetTimeManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Surface的用法示例。


在下文中一共展示了Surface::GetTimeManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
DispatcherTimer::Start ()
{
	started = true;
	stopped = false;

	Surface *surface = Deployment::GetCurrent ()->GetSurface ();

	if (clock) {
		clock->Reset ();
		clock->BeginOnTick ();
		clock->SetRootParentTime (surface->GetTimeManager()->GetCurrentTime());
	} else {
		AllocateClock ();
		char *name = g_strdup_printf ("DispatcherTimer (%p)", this);
		clock->SetName (name);

		surface->GetTimeManager()->AddClock (clock);

		clock->BeginOnTick ();
	}
}
开发者ID:lewing,项目名称:moon,代码行数:22,代码来源:timeline.cpp

示例2:

static void
bug_report_info (AboutConfigDialogPage *page)
{
	Surface *surface = page->GetDialog()->GetSurface();
	Deployment *deployment = page->GetDialog()->GetDeployment();
	MoonWindowGtk *window = page->GetDialog()->GetWindow();

	GtkWidget *dlg = gtk_dialog_new_with_buttons ("But Report Info",
						      NULL /* FIXME parent */,
						      (GtkDialogFlags)(GTK_DIALOG_NO_SEPARATOR | GTK_DIALOG_DESTROY_WITH_PARENT),
						      "Close", GTK_RESPONSE_CLOSE,
						      NULL);

	GtkWidget *vbox = GTK_DIALOG (dlg)->vbox;

	GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
	GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
						     GTK_ICON_SIZE_BUTTON);
	GtkWidget *label = gtk_label_new ("Cut and paste the information below into your bug report.  "
					  "Be aware this contains information about the current silverlight "
					  "application you are viewing.");
	GtkWidget *textview;
	GtkTextBuffer *buffer = gtk_text_buffer_new (NULL);
	GString *str = g_string_new ("");

	g_string_append_printf (str, "Source: %s\n", deployment->GetXapLocation());
	g_string_append_printf (str, "Width: %dpx\n", window->GetWidth ());
	g_string_append_printf (str, "Height: %dpx\n", window->GetHeight ());
	g_string_append_printf (str, "Background: %s\n", color_to_string (surface->GetBackgroundColor ()));
	g_string_append_printf (str, "RuntimeVersion: %s\n", deployment->GetRuntimeVersion() ? deployment->GetRuntimeVersion() : "(Unknown)");
	g_string_append_printf (str, "Windowless: %s\n", window->GetWidget() == NULL ? "yes" : "no");
	g_string_append_printf (str, "MaxFrameRate: %i\n", surface->GetTimeManager()->GetMaximumRefreshRate());

	g_string_append_printf (str, "Codecs: %s\n",
				Media::IsMSCodecsInstalled () ? "ms-codecs" :
#if INCLUDE_FFMPEG
				"ffmpeg"
#else
				"none"
#endif
				);


	g_string_append (str, "Build configuration: ");

#if DEBUG
	g_string_append (str, "debug");
#else
	g_string_append (str, "release");
#endif
#if SANITY
	g_string_append (str, ", sanity checks");
#endif
#if OBJECT_TRACKING
	g_string_append (str, ", object tracking");
#endif

	g_string_append (str, "\n");

	gtk_text_buffer_set_text (buffer, str->str, str->len);

	textview = gtk_text_view_new_with_buffer (buffer);

	g_string_free (str, TRUE);

	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);

	GtkWidget *image_align = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
	gtk_container_add (GTK_CONTAINER (image_align), image);

	gtk_box_pack_start (GTK_BOX (hbox), image_align, FALSE, FALSE, 0);
	gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);

	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);

	gtk_box_pack_start (GTK_BOX (vbox), textview, TRUE, TRUE, 0);

	gtk_widget_show_all (vbox);

	if (GTK_RESPONSE_CLOSE == gtk_dialog_run (GTK_DIALOG (dlg)))
		gtk_widget_destroy (dlg);
}
开发者ID:,项目名称:,代码行数:82,代码来源:


注:本文中的Surface::GetTimeManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。