Algunas Funciones y Estructuras de Datos XWindow

Similar documents
X Windows Version 11.5 A Concise Description

Index. A Aim of book, 3 Approach options taken here, 1 toolkits, 1 Approaches to options selection, 56

XCreateGC, XCopyGC, XChangeGC, XGetGCValues, XFreeGC, XGContextFromGC, XGCValues create or free graphics contexts and graphics context structure

Xwindows. Xwindows: Windows. Windows Drawing Events Advanced Topics. Window Models Creating Windows in X X11 Architecture. Before Windowing Systems

Events. Events and the Event Loop Animation Double Buffering. 1.5 Events 1

Appendix. Software. Overview... Data Types Used in the Starter Toolkit... Functions... Resources and Convenience Function of Paper Class Widgets...

Notes on creating graphical output using X-11 graphics. Ubuntu Virtual Machine

38.1 Tk_ConfigureWidget 337

Athena Widget Set - C Language Interface

OpenGL Drawing Widgets and Related Functions

Xmu Library. XVersion 11, Release 6.7. Don t ask.

Athena Widget Set C Language Interface

1 Goals of this exercise Some goals of this exercise are : 1. To know how to congure TCP/IP Network on linux desktop environment. 2. To get to know li

Event Dispatch. Review: Events

GUI Basics and Windowing Systems. Using X Windows as a case study

Data Transfer with UTM

GUI Basics and Windowing Systems

Volume One. Xlib Programming Manual

Display PostScript System

GUI Basics and Windowing Systems. Using X Windows as a case study

MIT-SHM The MIT Shared Memory Extension

Lesson 34. Write down program of maze solver. Maze Solver

Windowing Systems. (using X Windows as case study) GUI Architecture Base Window System Window Manager. Windowing Systems 1

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm

The graphigs Programming Interface: Technical Reference

Extending X for Double-Buffering, Multi-Buffering, and Stereo. Jeffrey Friedberg Larry Seiler Jeff Vroom

trim library Programming Guide - Version 2.0

CSE 431S Type Checking. Washington University Spring 2013

Basic Controls. Motif Programmer s Guide 1

In-Depth Coverage of the Icon Programming Language. Lost Languages SL5. The Icon Analyst / 1. In this issue. Basic Features.

Drawing in GTK+ Background. Windows and Clipping. CSci Graphical User Interface Programming Drawing in GTK+ Prof.

Security Extension Specification

Common Desktop Environment 1.0. Desktop KornShell User s Guide

Security Extension Specification Version 7.1 X11 Release 6.4

Research on Data Storage Structure of Object Pool for Intelligent Virtual Terminal Based on ISO11783

libtcod Documentation

12 CREATING NEW TYPES

SDL Standard Drawing Library

CS 4204 Computer Graphics

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4

Programming II (CS300)

Introduction to Programming Using Python Lecture 6. Dr. Zhang COSC 1437 Spring, 2018 March 01, 2018

Chapter 9 GUI Programming Using Tkinter. Copyright 2012 by Pearson Education, Inc. All Rights Reserved.

Xt Widget Classes. ApplicationShell. Composite. Constraint. Core. Object. OverrideShell. RectObj. Shell. TopLevelShell. TransientShell.

Lomse library. Tutorial 1 for X11

PostScript Internals Graphics II Spring 1999

KWin went XCB. Blue Systems. October X.Org Developer s Conference

Structures, Unions Alignment, Padding, Bit Fields Access, Initialization Compound Literals Opaque Structures Summary. Structures

Abstract Classes Interfaces CSCI 201 Principles of Software Development

Abstract Classes Interfaces CSCI 201 Principles of Software Development

Color and Pixmaps. Motif Programmer s Guide 1

PDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK.

DESIGNER X-Designer Release 8

X Toolkit Intrinsics C Language Interface

Variables in C. Variables in C. What Are Variables in C? CMSC 104, Fall 2012 John Y. Park

Extending X for Double-Buffering, Multi-Buffering, and Stereo

Display PostScript System

Programming: You will have 6 files all need to be located in the dir. named PA4:

MrLib: Extra GUI Libraries

X Toolkit Intrinsics - C Language Interface

Introducing Motif. Motif User s Guide 1

Display PostScript System

Laboratory Module Trees

Guile-GNOME: Atk. version , updated 9 December Bill Haneman Marc Mulcahy Padraig O Briain

Guile-GNOME: Libgnomecanvas

Xm Data Types. XmDirection. XmFontList. XmParseMapping. XmParseTable. XmRenderTable. XmString. XmStringDirection. XmStringTable. XmTab.

Lab 4. Out: Friday, February 25th, 2005

Designing Interactive Systems II

OpenGL. 1 OpenGL OpenGL 1.2 3D. (euske) 1. Client-Server Model OpenGL

1 Getting started with Processing

Application Note ANGS [Issued date August 1, 2011]

Programs. mwm. uil. xmbind. Motif Programmer s Reference 1

TEXT -> IMAGE ENCODING FLOWCHART (LSB METHOD) start. store color depth of screen. false. false initialize psuedo rand # generator.

Data Structures Unit 02

Heaps / Priority Queues

Xm Widget Classes. XmArrowButton. XmArrowButtonGadget. XmBulletinBoard. XmCascadeButton. XmCascadeButtonGadget. XmComboBox. XmCommand.

CSE 230 Intermediate Programming in C and C++

X Window System Protocol

CS240: Programming in C

Guile-GNOME: Atk. version , updated 2 September Bill Haneman Marc Mulcahy Padraig O Briain

Structure of a Program Using UIL and MRM

GWT - UIOBJECT CLASS

rfbproto.h 1/12 typedef struct { CARD16 x; CARD16 y;

Output models Drawing Rasterization Color models

ECE 3331, Dr. Hebert, Summer-3, 2016 HW 11 Hardcopy HW due Tues 07/19 Program due Sunday 07/17. Problem 1. Section 10.6, Exercise 3.

DESIGNER X-Designer Release 9

Variables in C. CMSC 104, Spring 2014 Christopher S. Marron. (thanks to John Park for slides) Tuesday, February 18, 14

CISC 1600 Lecture 3.1 Introduction to Processing

Watch the following for more announcements

Structures and Unions in C. Alan L. Cox

Data Storage. August 9, Indiana University. Geoffrey Brown, Bryce Himebaugh 2015 August 9, / 19

BROWN UNNERSITY Department of Computer Science Master's Thesis CS-92-M2

11 TREES DATA STRUCTURES AND ALGORITHMS IMPLEMENTATION & APPLICATIONS IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD

Advanced Data Structures Summary

Computer Graphics. Making Pictures. Computer Graphics CSC470 1

CSC 1051 Algorithms and Data Structures I. Midterm Examination March 2, Name:

Remote Procedure Call Implementations

McMaster Brand Standard for Websites

CSE 351: The Hardware/Software Interface. Section 2 Integer representations, two s complement, and bitwise operators

CSC 467 Lecture 13-14: Semantic Analysis

Transcription:

Algunas Funciones y Estructuras de Datos XWindow Display *XOpenDisplay(display_name) char *display_name; char *ServerVendor(display) int XDisplayWidth(display,screen_number) int screen_number; int XDisplayHeight(display,screen_number) int screen_number; int XDefaultScreen(display) DefaultRootWindow(display) RootWindow(display,screen_number) int screen_number; XCloseDisplay(display) Window XCreateSimpleWindow(display,parent,x,y,width,height, border_width,border,background) Window parent; unsigned int width,height; unsigned int border_width; unsigned long border; unsigned long background; XMapWindow(display,w) XMapRaised(display,w)

XChangeWindowAttributes(display,w,valuemask,attributes) unsigned long valuemask; XSetWindowAttributes *attributes; typedef struct { Pixmap background_pixmap; unsigned long background_pixel; Pixmap border_pixmap; unsigned long border_pixel; int bit_gravity; int win_gravity; int backing_store; unsigned long backing_planes; unsigned long backing_pixel; Bool save_under; long event_mask; long do_not_propagate_mask; Bool override_redirect; Colormap colormap; Cursor cursor; } XSetWindowAttributes; #define CWBackPixmap (1L<<0) #define CWBackPixel (1L<<1) #define CWBorderPixmap (1L<<2) #define CWBitGravity (1L<<3) #define CWWinGravity (1L<<4) #define CWBackingStore (1L<<5) #define CWBackingPlanes (1L<<6) #define CWBackingPixel (1L<<7) #define CWOverrideRedirect (1L<<8) #define CWSaveUnder (1L<<9) #define CWEventMask (1L<<10) #define CWDontPropagate (1L<<11) #define CWColormap (1L<<12) #define CWCursor (1L<<13) XMapSubwindows(display,w) XUnMapWindow(display,w) 2

XUnMapSubwindows(display,w) XFlush(display) XMoveWindow(diplay,window,x,y) Window *window; XResizeWindow(display,window,width,height) Window window; unsigned int width,height; XMoveResizeWindow(diplay,window,x,y,width,height) Window *window; unsigned int width,height; XSetWindowBorderWidth(display,w,width) unsigned int width; XRaiseWindow(display,w) XLowerWindow(display,w) XCirculateSubwindows(display,w,direction) int direction; XCirculateSubwindowsUp(display,w) XCirculateSubwindowsDown(display,w) 3

XRestackWindows(display,windows,n) Window windows[]; XConfigureWindow(display,w,value_mask,values) unsigned int value_mask; XWindowChanges *values; typedef struct{ int width,height; int border_width; Window sibling; int stack_mode; } XWindowChanges; Gestión de eventos. typedef struct { int type; unsigned long serial; Bool send_event; Window window; Window root; Window subwindow; Time time; int x, y; int x_root, y_root; unsigned int state; unsigned int button; /* Button1, Button2, Button3 */ Bool same_screen; } XButtonEvent; typedef XButtonEvent XButtonPressedEvent; typedef XButtonEvent XButtonReleasedEvent; 4

typedef struct { int type; unsigned long serial; Bool send_event; Displar *display; Window window; }XAnyEvent; typedef union _Xevent { int type; XAnyEvent xany; XKeyEvent xkey; XButtonEvent xbutton; XMotionEvent xmotion; XcrossingEvent xcorssing; XFocusChangeEvent xexpose; XGraphicsExposeEvent xgraphicsexpose; XNoExposeEvent xnoexpose; XVisibilityEvent xvisibility; XcreateWindowEvent xcreatewindow; XDestroyWindowEvent xdestroywindow; XUnmapEvent xunmap; XMapEvent xmap; XMapRequestEvent xmaprequest; XReparentEvent xreparent; XConfigureEvent xconfigure; XGravityEvent xgravity; XResizeRequestEvent xresizerequest; XConfigureRequestEvent xconfigurerequest; XCirculateEvent xcirculate; XCirculateRequestEvent xcirculaterequest; XPropertyEvent xproperty; XSelectionClearEvent xselectionclear; XSelectionRequestEvent xselectionrequest; XSelectionEvent xselection; XColormapEvent xcolormap; XClientMessageEvent xclient; XMappingEvent xmapping; XErrorEvent xerror; XKeymapEvent xkeymap; long pad[24; } XEvent; 5

XSelectInput (display,w,event_mask) long event_mask; XNextEvent (display,event_return) XEvent *event_return; XMaskEvent (display,event_mask,event_return) long event_mask; XEvent *event_return; XWindowEvent (display,w,event_mask,event_return) Window *w; long event_return; XEvent *event_return; Bool XCheckMaskEvent (display,event_mask,event_return) long event_mask; XEvent *event_return; Bool XCheckWindowEvent (display,w,event_mask,event_return) Window *w; long event_mask; XEvent *event_return; Bool XCheckTypedEvent (display,event_type,event_return) int event_type; XEvent *event_return; Bool XCheckTypedWindowEvent (display,w,event_type,event_return) int event_type; XEvent *event_return; 6

Teclado int XLookupString (event,string,length,key,cs); XKeyevent *event; char *string; int length; Keysym *key; XComposeStatus *cs; char *XKeysymToString (keysym); KeySym XStringToKeysmy (string); char *string; KeySym XKeycodeToKeysym (display,keycode,index); KeyCode keycode; int index; KeySym XLookupKeysym (event,index); XKeyEvent *event; int index; KeyCode XKeysymToKeycode (display,keysym); XRebindKeysym (display,keysym,list,n,string,m) KeySym *list; unsigned char *string; int m; IsCursorKey (keysym); IsFunctionKey (keysym); IsKeypadKey (keysym); IsMiscFunctionKey (keysym); 7

IsModifierKey (keysym); IsPFKey (keysym); Eventos Expose typedef struct { int type; unsigned long serial; Bool send_event; Window window; int width, height; int count; } XExposeEvent; Mapas de color Colormarp DefaultColormap (display,screen) int screen; Colormap XdefaultColormap (display,screen) int screen, typedef struct{ unsigned long pixel; unsigned short red,green blue; char flag; chard pad; } XColor; Status XAllocColor (display,cmap,&color) Colormap cmap; XColor color; Status XAllocNamedColor (display,cmap,name,&color,&exat) Colormap cmap; char *name; XColor color,exact; 8

XSetWindowBackground (diplay,w,pixel) unsigned long pixel; XSetWindowBorder (display,w,pixel) unsigned long pixel; Contextos Gráficos GC XCreateGC (display,drw,mask,values) Drawable dru; unsigned long mask; XGCValues *values; XChangeGC (display, gc, mask, values) unsigned long mask; XGCValues *values; XSetForeground (display,gc,foreground) unsigned long foreground; XSetBackground (display,gc,background) unsigned long foreground; Creación de pixmaps Pixmap XCreatePixmap(display,drawable,width,height,depth) Drawable drawable; unsigned int width, height; unsigned int depth; 9

XCopyArea(display,src_drawable,dest_drawable,gc,src_x,src_y, width,height,dest_x,dest_y) Drawable src_drawable,dest_drawable; int src_x,src_y; unsigned int width, height; int dest_x, dest_y; XCopyPlane(display,src_drawable,dest_drawable,gc,src_x,src_y, width,height,dest_x,dest_y,plane) Drawable src_drawable,dest_drawable; int src_x,src_y; unsigned int width, height; int dest_x, dest_y; unsigned long plane; XFreePixmap(display,pixmap) Pixmap pixmap; Primitivas gráficas XDrawPoints (display,drw,gc,points,n,mode) XPoint *points; int mode; typedef struct { short x,y; }XPoint; XDrawPoint (display,drw,gc,x,y) Display *display 10

XDrawSegments (display,drw,gc,segments,n) XSegment *segments; XDrawLines (display,drw gc,points,n,mode) XPoint *points; int mode; typedef structure{ short x1,y1,x2,y2; }XSegment; XDrawLine (display,drw,gc,x1,y1,x2,y2) int x1,y1,x2,y2; XSetLineAttributes (display,gc,line_width,line_style,cap_style,join_style) unsigned int line_width; int line_style; int cap_style; int join_style; XSetDashes (display,gc,offset,dash_list,n); int offset; char dash_list[]; XDrawRectangle (display,drw,gc,x,y,width,height) unsigned int width,height; 11

XDrawRectangles (display,drw,gc,rectangles,n) XRectangle rectangles[]; XDrawArc (display,drw,gc,x,y,width,height,angle1,angle2) unsigned int width,height; int angle1,angle2; XDrawArcs (display,drw,gc,arcs,n) XArc *arcs; typedef struct { short x,y; unsigned short width,height; short angle1,angle2; }XArc; XFillRectangle (display,drw,gc,x,y,width,height) unsigned int width,height; XFillRectangles (display,drw,gc,rectangles,n) XRectangle rectangles[]; 12

XFillArc (display,drw,gc,x,y,width,height,angle1,angle2) unsigned int width,height; int angle1,angle2; XFillArcs (display,drw,gc,arcs,n) XArc *arcs; XSetArcMode display,gc,arc_mode) int arc_mode; XFillPolygon (display,drw,gc,points,n,shape,mode) XPoint *points; int shape; int mode; XSetFillRule (display,gc,fill_rule) int fill_rule Primitivas para dibujar texto Font XLoadFont (display,name) char *name; XSetFont (display,gc,font) Font font; 13

XDrawString (display,drw,gc,x,y,string,l) char *string; int l; XDrawImageString (display,drw,gc,x,y,string, 1) int x,y,; char *string; int l; XFontStruct *XQueryFont(display,fid) Display *display, Font fid; XFontStruct *XLoadQueryFont(display,name) Display *display, char *name; int XTextWidth(font_struc,string,n) XFontStruc *font_struct; char *string; XTextExtents(font_struct,string,n,dir,ascent,descent,overall) XFontStruct *font_struct; char *string; int *dir; int *ascent,*descent; XCharStruct *overall; 14

Algunas Funciones y Estructuras de Datos OSF/Motif y XtIntrinsics Creación del contexto de la aplicación. Widget XtAppInitialize(app_context_return,application_class, options, num_options, argc_in_out, argv_in_out, fallback_resources, args, num_args) XtAppContext app_context_return; String application_class; XrmOptionDescList options; Cardinal num_options; Cardinal *argc_in_out; String *argv_in_out; String *fallback_resources; Arglist args; Cardinal num_args Creación y gestión de Widgets. Widget XmCreate<WidgetClass>(parent, name, args, argcount) Widget parent; String name; ArgList args; Cardinal argcount; void XtManageChild(child) Widget child; XtRealizeWidget(w) Widget w; Gestión del bucle de eventos. void XtAppMainLoop(app_context) XtAppContext app_context; 15

Configuración de recursos. typedef struct { String name; XtArgVal value; } Arg; XtSetArg(arg, resource, value) Arg arg; String resource; XtArgVal value; Llamadas de retorno y gestores de eventos Xwindow. void XtAddEventHandler(w, mask, nonmask, proc, client_data) Widget w; EventMask mask; Boolean nonmask; XtEventHandler proc; XtPointer client_data; XtEventHandler proc(w, client_data, pevent) Widget w; XtPinter client_data; Xevent *pevent; void XtAddCallback(w, callback_name, proc, client_data) Widget w; String callback_name; XtCallbackProc proc; XtPointer client_data; XtCallbackProc proc(w, client_data, call_data) Widget w; XtPointer client_data; XtPointer call_data; Gestión de XmString s. XmString XmStringCreateSimple(text) char *text; 16

XmString XmStringCreate(text, charset) char *text; XmStringCharSet charset; void XmStringFree(string) XmString string; 17