marco 1.29.1
Window manager
Loading...
Searching...
No Matches
test-gravity.c File Reference
View source
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for test-gravity.c:

Data Structures

struct  Rectangle
 
struct  MotifWmHints
 

Macros

#define WINDOW_WIDTH   100
 
#define WINDOW_HEIGHT   100
 
#define MWM_HINTS_FUNCTIONS   (1L << 0)
 
#define MWM_HINTS_DECORATIONS   (1L << 1)
 
#define MWM_HINTS_INPUT_MODE   (1L << 2)
 
#define MWM_HINTS_STATUS   (1L << 3)
 

Typedefs

typedef struct MotifWmHints MwmHints
 

Functions

static const char * window_gravity_to_string (int gravity)
 
static void calculate_position (int i, int is_doubled, int *x, int *y)
 
static int find_window (Window window)
 
int main (int argc, char **argv)
 

Variables

static int gravities [10]
 
static Window windows [10]
 
static int doubled [10] = { 0, }
 
static Rectangle window_rects [10]
 
static int x_offset [3] = { 0, - WINDOW_WIDTH/2, -WINDOW_WIDTH }
 
static int y_offset [3] = { 0, - WINDOW_HEIGHT/2, -WINDOW_HEIGHT }
 
static double screen_x_fraction [3] = { 0, 0.5, 1.0 }
 
static double screen_y_fraction [3] = { 0, 0.5, 1.0 }
 
static int screen_width
 
static int screen_height
 

Macro Definition Documentation

◆ MWM_HINTS_DECORATIONS

#define MWM_HINTS_DECORATIONS   (1L << 1)

◆ MWM_HINTS_FUNCTIONS

#define MWM_HINTS_FUNCTIONS   (1L << 0)

◆ MWM_HINTS_INPUT_MODE

#define MWM_HINTS_INPUT_MODE   (1L << 2)

◆ MWM_HINTS_STATUS

#define MWM_HINTS_STATUS   (1L << 3)

◆ WINDOW_HEIGHT

#define WINDOW_HEIGHT   100

◆ WINDOW_WIDTH

#define WINDOW_WIDTH   100

Typedef Documentation

◆ MwmHints

typedef struct MotifWmHints MwmHints

Function Documentation

◆ calculate_position()

static void calculate_position ( int  i,
int  is_doubled,
int *  x,
int *  y 
)
static

◆ find_window()

static int find_window ( Window  window)
static

References windows.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

References calculate_position(), MotifWmHints::decorations, doubled, find_window(), MotifWmHints::flags, gravities, Rectangle::height, MWM_HINTS_DECORATIONS, NULL, screen, screen_height, screen_width, Rectangle::width, window_gravity_to_string(), WINDOW_HEIGHT, window_rects, WINDOW_WIDTH, windows, Rectangle::x, and Rectangle::y.

Here is the call graph for this function:

◆ window_gravity_to_string()

static const char * window_gravity_to_string ( int  gravity)
static

Referenced by main().

Variable Documentation

◆ doubled

int doubled[10] = { 0, }
static

Referenced by main().

◆ gravities

int gravities[10]
static
Initial value:
= {
NorthWestGravity,
NorthGravity,
NorthEastGravity,
WestGravity,
CenterGravity,
EastGravity,
SouthWestGravity,
SouthGravity,
SouthEastGravity,
StaticGravity
}

Referenced by main().

◆ screen_height

int screen_height
static

◆ screen_width

◆ screen_x_fraction

double screen_x_fraction[3] = { 0, 0.5, 1.0 }
static

Referenced by calculate_position().

◆ screen_y_fraction

double screen_y_fraction[3] = { 0, 0.5, 1.0 }
static

Referenced by calculate_position().

◆ window_rects

Rectangle window_rects[10]
static

Referenced by main().

◆ windows

◆ x_offset

int x_offset[3] = { 0, - WINDOW_WIDTH/2, -WINDOW_WIDTH }
static

Referenced by calculate_position().

◆ y_offset

int y_offset[3] = { 0, - WINDOW_HEIGHT/2, -WINDOW_HEIGHT }
static

Referenced by calculate_position().