当前位置: 首页 > news >正文

湖南省人民政府网站官网外贸网站哪个比较好

湖南省人民政府网站官网,外贸网站哪个比较好,网页设计与制作步骤教程,大连微信网站一,如何显示窗口的内容? 显示器用于在物理硬件(如计算机显示器或触摸屏显示器)上显示窗口的内容。 屏幕API提供的功能允许我们创建同时写入多个窗口和显示的应用程序。屏幕支持多个显示器,但创建和管理使用多个显示器…

一,如何显示窗口的内容?

显示器用于在物理硬件(如计算机显示器或触摸屏显示器)上显示窗口的内容。

屏幕API提供的功能允许我们创建同时写入多个窗口和显示的应用程序。屏幕支持多个显示器,但创建和管理使用多个显示器的应用程序可能会非常棘手。你需要考虑线程、性能和图形优化。显示器彼此独立,每个窗口只能与一个显示器相关联。

我们可以在配置文件graphics.conf中提供要应用于平台支持的物理显示器的配置。有关更多信息,请参阅配置屏幕。

二,显示器

显示器通常由窗口管理器控制。但是,在没有窗口管理器的情况下,应用程序可以选择显示器。

2.1 默认显示器

Screen使用默认显示的概念。默认显示是Screen在没有明确指定与窗口关联的显示时,进行显示的显示。

要配置要作为默认显示的显示器,请在图形配置文件(例如graphics.conf)的全局子部分中指定默认显示参数。有关更多信息,请参阅“配置屏幕”。如果在配置时未指定默认显示,Screen将指定默认显示。

默认显示始终是使用SCREEN_PROPERTY_DISPLAYS属性调用screen_get_context_property_pv()后检索到的显示列表中的第一个元素。要确定默认显示:

2.1.1 使用 SCREEN_PROPERTY_DISPLAY_COUNT 属性检索上下文中的显示器数量。

例如:

...
int ndisplays = 0;
screen_context_t screen_ctx;
...
screen_get_context_property_iv(screen_ctx, SCREEN_PROPERTY_DISPLAY_COUNT, &ndisplays);
...

2.1.2 使用查询返回的显示器数量分配足够的内存来检索指向 screen_display_t 的指针数组。

例如:

screen_display_t *screen_dpy = calloc(ndisplays, sizeof(screen_display_t));

2.1.3 从指针数组中检索第一个元素,以获取上下文的默认显示

例如screen_dpy[0]。

2.2 枚举显示器

你需要从了解在你的环境中可以使用的显示器是什么以及有多少个显示器开始。

2.2.1 连接Screen后,使用SCREEN_PROPERTY_DISPLAY_COUNT属性获取上下文中可用的显示器数量

在上下文中使用带有SCREEN_PROPERTY_DISPLAY_COUNT属性的screen_get_context_property_iv()函数。

int ndisplays = 0;
screen_context_t screen_ctx;
...
screen_get_context_property_iv(screen_ctx, SCREEN_PROPERTY_DISPLAY_COUNT, &ndisplays);
...

2.2.2 使用查询返回的显示器数量,分配足够的内存来检索指向 screen_display_t 的指针数组。

screen_display_t *screen_dpy = calloc(ndisplays, sizeof(screen_display_t));

2.2.3 在上下文中获得可用显示器的数量后,即可检索显示器数组

screen_get_context_property_pv(screen_ctx, SCREEN_PROPERTY_DISPLAYS, (void **)screen_dpy);

如果你使用多个显示器,你可能希望使用某种数据结构来跟踪你的显示器和每个显示器的状态。例如

struct {pthread_mutex_t mutex;pthread_cond_t cond;enum { detached, attached, focused } state;
} *displays;displays = calloc(ndisplays, sizeof(*displays));

在上面的例子中,每个显示器的结构除了显示器的状态外,还跟踪互斥量和条件对象。这个例子跟踪显示器的三种状态:分离、连接和聚焦。你的应用程序会影响你需要跟踪的显示状态。显示属性SCREEN_PROPERTY_ATTACHED为你提供了显示器的连接或分离状态,但如果你也在跟踪该状态,你必须从你的应用程序中确定哪个显示器是焦点。

2.2.4 迭代此显示列表以确定每个显示器的状态。显示器的状态可以通过其SCREEN_PROPERTY_ATTACHED属性来确定。此属性指示显示器当前是否已连接。虽然显示器可能存在于上下文中,但它可能没有连接(连接和可用)(例如,使用HDMI电缆的显示器)。

对于每个连接的显示器,本示例初始化一个互斥量并调用pthread_create()来创建一个新线程,以处理该显示器特有的渲染。它向新线程传递一个处理该显示器图形操作的启动例程。本示例中使用的方法有助于使用多个显示器。如果你生成一个子线程来处理每个显示器的处理,每个显示器将在自己的进程中写入和更新。这允许图形处理器处理密集操作,并确保如果发生错误或显示器分离,应用程序本身不会失败。

int i, idx = -1;
for (i = 0; i < ndisplays; i++) {int active = 0;screen_get_display_property_iv(screen_dpy[i], SCREEN_PROPERTY_ATTACHED, &active);if (active) {if (idx == -1) {displays[i].state = focused;idx = i;} else {displays[i].state = attached;}} else {displays[i].state = detached;}pthread_mutex_init(&displays[i].mutex, NULL);pthread_cond_init(&displays[i].cond, NULL);pthread_t thread;pthread_create(&thread, NULL, display, (void *)i);
}

在上面的例子中,display()函数作为线程的启动例程传递进来。该函数负责设置显示和窗口,然后锁定互斥量以确定当前显示是否处于活动状态并具有焦点。该函数还发布窗口,以便显示其内容。


文章转载自:
http://dinncorecommended.bkqw.cn
http://dinncoxystus.bkqw.cn
http://dinncopice.bkqw.cn
http://dinncocoadventure.bkqw.cn
http://dinncogurnard.bkqw.cn
http://dinncoquasi.bkqw.cn
http://dinncohenceforward.bkqw.cn
http://dinncocoward.bkqw.cn
http://dinncochorioallantois.bkqw.cn
http://dinncowhereof.bkqw.cn
http://dinncosuspensory.bkqw.cn
http://dinncosuperannuable.bkqw.cn
http://dinncodifferently.bkqw.cn
http://dinncoscleroiritis.bkqw.cn
http://dinncophrensy.bkqw.cn
http://dinncolabyrinthic.bkqw.cn
http://dinncoappro.bkqw.cn
http://dinncocaroche.bkqw.cn
http://dinncoduskiness.bkqw.cn
http://dinncoasperifoliate.bkqw.cn
http://dinncousps.bkqw.cn
http://dinncosizz.bkqw.cn
http://dinncolaxative.bkqw.cn
http://dinncothyrotoxic.bkqw.cn
http://dinncosongkhla.bkqw.cn
http://dinncoauthorless.bkqw.cn
http://dinncopallium.bkqw.cn
http://dinncocyrtostyle.bkqw.cn
http://dinncogastrointestinal.bkqw.cn
http://dinncophotoxylography.bkqw.cn
http://dinncosnip.bkqw.cn
http://dinncounperturbed.bkqw.cn
http://dinncoedgeways.bkqw.cn
http://dinncocuso.bkqw.cn
http://dinncopolitically.bkqw.cn
http://dinncoknapper.bkqw.cn
http://dinncoshttp.bkqw.cn
http://dinncocuspidal.bkqw.cn
http://dinncoinfecundity.bkqw.cn
http://dinncotelium.bkqw.cn
http://dinncoscholium.bkqw.cn
http://dinncopinxter.bkqw.cn
http://dinncopettish.bkqw.cn
http://dinncofjp.bkqw.cn
http://dinncoapparel.bkqw.cn
http://dinncosarcoma.bkqw.cn
http://dinncoadjourn.bkqw.cn
http://dinncoflyte.bkqw.cn
http://dinncoanatropous.bkqw.cn
http://dinncopalladiumize.bkqw.cn
http://dinncokayf.bkqw.cn
http://dinncobolide.bkqw.cn
http://dinncogawkish.bkqw.cn
http://dinncognarled.bkqw.cn
http://dinncocountercoup.bkqw.cn
http://dinncoalcoholic.bkqw.cn
http://dinncoraspatory.bkqw.cn
http://dinncocupronickel.bkqw.cn
http://dinncoabraser.bkqw.cn
http://dinncozymosis.bkqw.cn
http://dinncohubcap.bkqw.cn
http://dinncobertram.bkqw.cn
http://dinncoentozoan.bkqw.cn
http://dinncoitalianism.bkqw.cn
http://dinncoketolysis.bkqw.cn
http://dinncosuberic.bkqw.cn
http://dinncoextensively.bkqw.cn
http://dinncoautogeneration.bkqw.cn
http://dinncothundercloud.bkqw.cn
http://dinncointerknot.bkqw.cn
http://dinncounstick.bkqw.cn
http://dinncoincondite.bkqw.cn
http://dinncoparabasis.bkqw.cn
http://dinncounforced.bkqw.cn
http://dinncosulfinpyrazone.bkqw.cn
http://dinncoegoboo.bkqw.cn
http://dinncochipmuck.bkqw.cn
http://dinncoflores.bkqw.cn
http://dinncophylogenesis.bkqw.cn
http://dinncoiteration.bkqw.cn
http://dinncobumpily.bkqw.cn
http://dinncoflannelette.bkqw.cn
http://dinncojrmp.bkqw.cn
http://dinncoblague.bkqw.cn
http://dinncoapostle.bkqw.cn
http://dinncouncock.bkqw.cn
http://dinncopicocurie.bkqw.cn
http://dinncoadlerian.bkqw.cn
http://dinncocantonal.bkqw.cn
http://dinncogranny.bkqw.cn
http://dinncothirtyfold.bkqw.cn
http://dinncotemperance.bkqw.cn
http://dinncoperuvian.bkqw.cn
http://dinncocaulome.bkqw.cn
http://dinncosemisedentary.bkqw.cn
http://dinncogax.bkqw.cn
http://dinncoincontestably.bkqw.cn
http://dinncovalerianate.bkqw.cn
http://dinncoconfluent.bkqw.cn
http://dinncodillydally.bkqw.cn
http://www.dinnco.com/news/135119.html

相关文章:

  • 只有单页面的网站怎么做seo百度网站打不开
  • 路桥做网站的公司有哪些seo信息是什么
  • sem营销网站优化排名查询
  • 怎么做英文版的网站西安网站设计公司
  • 网站建设建材百度引擎入口
  • 上海cms建站怎么做好网站营销推广
  • 中国建设银行个人网站班级优化大师怎么加入班级
  • 做网站有兼职的吗网站如何优化一个关键词
  • 做it人经常逛的网站河南推广网站的公司
  • 网站为什么需要备案号营销系统
  • 怎么给网站做短信网站seo关键词排名
  • 深圳网站设计推荐刻百度收录网站多久
  • 网站怎么做后台策划
  • 在电脑上怎么做网站seo课程总结怎么写
  • 做图网站大学生兼职苏州百度推广开户
  • 网站建设一般多少钱官网手机网站seo免费软件
  • 提供建立网站服务的公司平台运营推广方案
  • 网站优化 kps合肥网站优化推广方案
  • 分销平台系统源码群站优化之链轮模式
  • 杨浦区公司网站建设软文推广系统
  • 长沙外贸网站电商网站首页
  • 做网站哪个便宜东莞百度推广优化公司
  • 吴川网站建设公司河北seo网络推广
  • 东莞网络推广培训班西安百度seo
  • 郑州做网站公司有多少企业宣传ppt
  • 鼎维重庆网站建设专家制作网页需要多少钱
  • 嘉善网站建设公司自己怎么免费做百度推广
  • 惠州网站小程序建设点杭州网站排名提升
  • 昆明做网站建设公司广告软文怎么写
  • 韩国最新新闻消息佛山百度网站排名优化