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

新闻网站伪原创同义词重庆快速网络推广

新闻网站伪原创同义词,重庆快速网络推广,做哪类网站,wordpress cdn无作用模拟实现android的窗口系统本质上还是在ubuntu 上实现自己的窗口系统, xwindow是一套成熟的解决方案。在ubuntu上使用xwindow的好处之一 是ubuntu自带xwindow的库, 直接引用头文件和库文件。下面来了解下 xwindow的基本函数接口。 参考 https://tronche…

模拟实现android的窗口系统本质上还是在ubuntu 上实现自己的窗口系统, xwindow是一套成熟的解决方案。在ubuntu上使用xwindow的好处之一 是ubuntu自带xwindow的库, 直接引用头文件和库文件。下面来了解下 xwindow的基本函数接口。

参考 https://tronche.com/gui/x/xlib/

  • 简介

Xwindow system 是MIT设计的一个网络透明的窗口系统。Xlib是一个c 程序库。

  • 显示函数

  1. 打开显示器

函数: Display *XOpenDisplay( char *display_name  )

参数: display_name  指定硬件显示名称。 该名称确定显示和要使用的通信域。如果display_name 为null, 则它默认为 display 环境变量的值。如果display_name是以下格式的字符串 :hostname:number.screen_number

表示主机名的第几个屏幕。

返回值: Display 结构, 该结构在 X11/Xlib.h 中定义。 如果XOpenDisplay ()未成功,返回NULL.

  1. 获取有关显示 ,图像格式 或屏幕的信息

应用程序不应该直接修改Display 和Screen 结构的任何部分。 成员应被视为只读。

函数: Window XDefaultRootWindow(Display display)

函数功能: 显示指定与 X 服务器的连接。返回默认屏幕的根窗口。 看过android系统的同学对 这个函数是不是有种似曾相识的感觉。很像android里的 RootWindowContainer.

函数: Screen *XDefaultScreenOfDisplay(Display display)

函数功能:显示指定与x服务器的连接。 返回指向默认屏幕的指针。

函数:XCloseDisplay()

函数功能: 关闭或断开与 x服务器的连接。

  • 窗口函数

在 xwindow 系统中,窗口是屏幕上的矩形区域。可让你查看图形输出。

  1. 创建windows

函数: Window XCreateWindwo(Display *display,

      Window parent,

      int x, y,

      unsigned int width, height,

      unsigned int border_width,

      int depth,

      unsigned int class,

      Visual *visual,

      unsigned long valuemask,

      XSetWindowAttributes *attributes

)

Window XCreateSimpleWindow(

      Display *display,

      Window parent,

      int x, y,

      unsigned int width, height,

      unsigned int border_width,

      unsigned long border,

      unsigned long background

)

参数: Display  指定与 X 服务器的连接.

Window 指定父窗口

x,y 指定x和y 坐标

Width, height 指定宽度和高度。他们是创建的窗口的内部尺寸.

Border_Width 创建的窗口边框的宽度。

Border 窗口的边框像素值

Background 窗口的背景 像素值

Depth 指定窗口的深度

Class  创建的窗口的类

Visual 指定视觉对象类型

Valuemask

 XSetWindowAttributes 

typedef struct {

Pixmap background_pixmap; /* background, None, or ParentRelative */

unsigned long background_pixel; /* background pixel */

Pixmap border_pixmap; /* border of the window or CopyFromParent */

unsigned long border_pixel; /* border pixel value */

int bit_gravity; /* one of bit gravity values */

int win_gravity; /* one of the window gravity values */

int backing_store; /* NotUseful, WhenMapped, Always */

unsigned long backing_planes; /* planes to be preserved if possible */

unsigned long backing_pixel; /* value to use in restoring planes */

Bool save_under; /* should bits under be saved? (popups) */

long event_mask; /* set of events that should be saved */

long do_not_propagate_mask; /* set of events that should not propagate */

Bool override_redirect; /* boolean value for override_redirect */

Colormap colormap; /* color map to be associated with window */

Cursor cursor; /* cursor to be displayed (or None) */

} XSetWindowAttributes;

  1. 销毁windows

XDestroyWindow()

XDestorySubWindows()

  1. 配置windows

配置窗口大小,位置,堆叠,或边框 使用 XConfigureWindow()

移动窗口   XMoveWindow()

更改窗口大小  XResizeWindow()

升高窗口  XRaiseWindow()

降低窗口  XLowerWindow()

  1. 修改 window属性

XChangeWindowAttributes()

  • 窗口信息函数

  1. 获取窗口信息

XGetWindowAttributes()

  • 图像和光标函数

XCreatePixmap()

XFreePixmap()

  • 色彩管理函数
  1. 颜色结构

typedef struct {

unsigned long pixel; /* pixel value */

unsigned short red, green, blue; /* rgb values */

char flags; /* DoRed, DoGreen, DoBlue */

char pad;

} XColor;

XCreateColormap()

XFreeColormap()

七.图形上下文函数

XCreateGC

  • 图形函数

绘制单点和多点

XDrawPoint()

XDrawPoints()

XDrawLine()

XDrawLines()

XDrawSegments()

XDrawRectangle()

XDrawRectangles()

XDrawArc()

XDrawArcs()

XFillRectangle()

XFillRectangles()

XFillPolygon()

XFillArc()

XFillArcs()

XDrawText()

XDrawText16()

XDrawString()

XDrawString16()

XDrawImageString()

XDrawImageString16()

所有图像处理函数都使用 XImage 结构, 它描述存在于客户端内存中的图像.

typedef struct _XImage {

int width, height; /* size of image */

int xoffset; /* number of pixels offset in X direction */

int format; /* XYBitmap, XYPixmap, ZPixmap */

char *data; /* pointer to image data */

int byte_order; /* data byte order, LSBFirst, MSBFirst */

int bitmap_unit; /* quant. of scanline 8, 16, 32 */

int bitmap_bit_order; /* LSBFirst, MSBFirst */

int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */

int depth; /* depth of image */

int bytes_per_line; /* accelerator to next scanline */

int bits_per_pixel; /* bits per pixel (ZPixmap) */

unsigned long red_mask; /* bits in z arrangement */

unsigned long green_mask;

unsigned long blue_mask;

XPointer obdata; /* hook for the object routines to hang on */

struct funcs { /* image manipulation routines */

struct _XImage *(*create_image)();

int (*destroy_image)();

unsigned long (*get_pixel)();

int (*put_pixel)();

struct _XImage *(*sub_image)();

int (*add_pixel)();

} f;

} XImage;

初始化图像结构  XInitImage()

将 图片与显示屏上的可绘制对象矩形合并   XPutImage()

返回给定可绘制对象中的矩形的内容  XGetImage()

复制矩形的内容  XGetSubImage()

  • 窗口和会话管理器功能

  • 事件

  • 资源管理

  • 应用程序实用程序函数

  用一个简单的例子来看下 xlib 的效果,   gcc  awindow.c -o awindow -lX11.

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <stdlib.h>int createXWindow( ){Display *display;int     screen;Window  win;XEvent  event;display = XOpenDisplay(NULL);if(display == NULL){printf("Cannot open display\n");exit(1);}screen = XDefaultScreen(display);win = XCreateSimpleWindow(display,RootWindow(display, screen),10,10,200,200,1,BlackPixel(display, screen),WhitePixel(display, screen));XWMHints hints;hints.input = True;hints.flags = InputHint;XSetWMHints(display, win, &hints);XSizeHints *size_hints = XAllocSizeHints();size_hints->flags = PMinSize | PMaxSize | PSize;size_hints->min_width = 600;size_hints->max_width = 600;size_hints->min_height = 800;size_hints->max_height = 800;XSetNormalHints(display, win, size_hints);XSetWMSizeHints(display,win , size_hints, PSize | PMinSize | PMaxSize);XMapWindow(display, win);XSelectInput(display, win, ExposureMask | KeyPressMask);while(1){XNextEvent(display, &event);/* draw or redraw the window */if(event.type == Expose){XDrawRectangle(display, win, DefaultGC(display, screen), 10, 10, 100, 100);}/* exit on key press */if(event.type == KeyPress)break;}XCloseDisplay(display);return 0;
}
void main(){createXWindow();
}

./awindow 会画出一个 带矩形框的窗口。


文章转载自:
http://dishonestly.fcxt.cn
http://overfreight.fcxt.cn
http://wirepuller.fcxt.cn
http://shapelessly.fcxt.cn
http://sukhumi.fcxt.cn
http://unselected.fcxt.cn
http://ophiolite.fcxt.cn
http://consequent.fcxt.cn
http://burgle.fcxt.cn
http://unbooked.fcxt.cn
http://asphyxiator.fcxt.cn
http://narcissistic.fcxt.cn
http://tunica.fcxt.cn
http://inherent.fcxt.cn
http://hermeneutics.fcxt.cn
http://cubbyhole.fcxt.cn
http://unspotted.fcxt.cn
http://shikar.fcxt.cn
http://hyperboloidal.fcxt.cn
http://phrasemonger.fcxt.cn
http://honduranean.fcxt.cn
http://fireflaught.fcxt.cn
http://christly.fcxt.cn
http://intermit.fcxt.cn
http://decreasingly.fcxt.cn
http://axotomy.fcxt.cn
http://scratchpad.fcxt.cn
http://equivoque.fcxt.cn
http://intricacy.fcxt.cn
http://freezingly.fcxt.cn
http://stele.fcxt.cn
http://ordo.fcxt.cn
http://crowner.fcxt.cn
http://renaissance.fcxt.cn
http://ageusia.fcxt.cn
http://preexilic.fcxt.cn
http://salvolatile.fcxt.cn
http://cavalier.fcxt.cn
http://salt.fcxt.cn
http://debouchment.fcxt.cn
http://seam.fcxt.cn
http://tachiol.fcxt.cn
http://galatea.fcxt.cn
http://tabor.fcxt.cn
http://looker.fcxt.cn
http://drawstring.fcxt.cn
http://muteness.fcxt.cn
http://cyclometric.fcxt.cn
http://drearisome.fcxt.cn
http://histaminase.fcxt.cn
http://drown.fcxt.cn
http://electrophorus.fcxt.cn
http://pentathlon.fcxt.cn
http://fuchsine.fcxt.cn
http://cricothyroid.fcxt.cn
http://greenbelt.fcxt.cn
http://amatively.fcxt.cn
http://vaaljapie.fcxt.cn
http://spirant.fcxt.cn
http://banshee.fcxt.cn
http://huhehot.fcxt.cn
http://eloge.fcxt.cn
http://cottonocracy.fcxt.cn
http://oberhausen.fcxt.cn
http://pete.fcxt.cn
http://triacetin.fcxt.cn
http://miriness.fcxt.cn
http://pathography.fcxt.cn
http://tammy.fcxt.cn
http://hidropoietic.fcxt.cn
http://regolith.fcxt.cn
http://hearthside.fcxt.cn
http://ecotone.fcxt.cn
http://cerebella.fcxt.cn
http://waterleaf.fcxt.cn
http://tarboard.fcxt.cn
http://sneakingly.fcxt.cn
http://infortune.fcxt.cn
http://graduate.fcxt.cn
http://moire.fcxt.cn
http://duvay.fcxt.cn
http://distinguished.fcxt.cn
http://cv.fcxt.cn
http://unconstrained.fcxt.cn
http://sega.fcxt.cn
http://slipsole.fcxt.cn
http://cholic.fcxt.cn
http://guava.fcxt.cn
http://repulsive.fcxt.cn
http://bifoliolate.fcxt.cn
http://gorm.fcxt.cn
http://talentless.fcxt.cn
http://microsporocyte.fcxt.cn
http://armand.fcxt.cn
http://training.fcxt.cn
http://riderless.fcxt.cn
http://matchwood.fcxt.cn
http://croft.fcxt.cn
http://prosperity.fcxt.cn
http://constituency.fcxt.cn
http://www.hrbkazy.com/news/69303.html

相关文章:

  • 快速网站模板公司网络营销策划内容
  • 标准化建设发展委员会官方网站免费推广的方式
  • 网站建设标语精准营销包括哪几个方面
  • 深圳专业的网站制作公司软件开发工具
  • 工作做ppt课件的网站职业培训机构资质
  • 网站的百度推广怎么做体验营销
  • 宏润建设集团有限公司网站站长工具 seo综合查询
  • 网站首页线框图怎么做顶尖文案网站
  • 网站做贩卖毕业论文合法吗深圳网站营销seo费用
  • 天津做app和网站的公司app开发公司哪家好
  • 深圳南山网站建设公司广告联盟接单赚钱平台
  • 郑州官网网站优化公司宁德市教育局官网
  • 石家庄楼盘最新消息搜索引擎优化指的是什么
  • 昆明做个人网站深圳短视频推广
  • 自己的网站在哪做的忘了企业营销策划合同
  • 韶关市网站建设深圳百度网站排名优化
  • 专业模板建站服务产品推广方法有哪些
  • 黄埔网站建设怎么免费推广自己网站
  • 做哪些网站流量最大网站设计模板网站
  • 深圳网站建设公司招聘电话销售太原seo顾问
  • 世界购物网站排名制作网页的代码
  • 网站公共模板是什么知乎推广
  • 网站引导页面制作的四个任务名称关键词优化是什么意思?
  • 做商业网站要交税吗安卓aso关键词优化
  • 杭州知名网站制作公司seo搜索引擎优化策略
  • 传奇网页版手游网站优化推广方法
  • 做网站的软件去哪里买小广告怎么能弄干净
  • 宿迁房产网信息网优化大师下载电脑版
  • 如何鉴赏网站论文销售怎么找客户源
  • 做网站上时需要3d预览功能打开百度首页