PIPS
xv_icons.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/text.h>
#include <xview/svrimage.h>
#include <xview/icon.h>
#include <X11/Xlib.h>
#include "genC.h"
#include "misc.h"
#include "wpips.h"
#include "pips.icon"
#include "ICFG.icon"
#include "WP65_PE.icon"
#include "WP65_bank.icon"
#include "callgraph.icon"
#include "parallel.icon"
#include "sequential.icon"
#include "user.icon"
#include "logo_pips_small.xbm"
+ Include dependency graph for xv_icons.c:

Go to the source code of this file.

Data Structures

struct  pips_icons_type
 

Enumerations

enum  { ICON_TEXT_HEIGHT = 20 }
 

Functions

void create_icons ()
 include "logo_pips_small.xpm" More...
 
Server_image create_status_window_pips_image ()
 
void set_pips_icon (Frame frame, char *icon_name, char *icon_text)
 

Variables

Server_image wpips_positive_server_image
 To store the negative image for a blinking icon in the interrupt button: More...
 
Server_image wpips_negative_server_image
 
static Server_image pips_icon_server_image [LAST_ICON]
 
static pips_icons_type pips_icons_data [LAST_ICON]
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ICON_TEXT_HEIGHT 

Definition at line 44 of file xv_icons.c.

44 {ICON_TEXT_HEIGHT = 20};
@ ICON_TEXT_HEIGHT
Definition: xv_icons.c:41

Function Documentation

◆ create_icons()

void create_icons ( )

include "logo_pips_small.xpm"

Definition at line 92 of file xv_icons.c.

93 {
94  int i;
95 
96  for(i = 0; i < LAST_ICON; i++) {
98  (Server_image) xv_create(NULL, SERVER_IMAGE,
99  XV_WIDTH, 64,
100  XV_HEIGHT, 64,
101  SERVER_IMAGE_BITS, &pips_icons_data[i].bitmap[0],
102  NULL);
103  }
104 
105  set_pips_icon(main_frame, "pips", "Wpips");
106 }
@ LAST_ICON
Definition: gpips-local.h:56
GtkWidget * main_frame
If we are in the Emacs mode, the log_frame is no longer really used:
Definition: gpips.c:60
void set_pips_icon(Frame frame, char *icon_name, char *icon_text)
Definition: xv_icons.c:118
static pips_icons_type pips_icons_data[LAST_ICON]
Definition: xv_icons.c:59
static Server_image pips_icon_server_image[LAST_ICON]
Definition: xv_icons.c:51

References LAST_ICON, main_frame, pips_icon_server_image, pips_icons_data, and set_pips_icon().

+ Here is the call graph for this function:

◆ create_status_window_pips_image()

Server_image create_status_window_pips_image ( )

To store the negative image for a blinking icon in the interrupt button:

Pixmap logo_pips_small_pixmap;

logo_pips_small_pixmap = XCreatePixmap((Display *) xv_get(main_frame, XV_DISPLAY), (Window) xv_get(main_frame, XV_ID),

ERVER_IMAGE_PIXMAP, logo_pips_small, SERVER_IMAGE_X_BITS, logo_pips_small, SERVER_IMAGE_DEPTH, 8, XV_WIDTH, 56, XV_HEIGHT, 51,

Definition at line 110 of file xv_icons.c.

111 {
112  /* To store the negative image for a blinking icon in the interrupt
113  button: */
114  char * inverted_pips_icon;
115  int i;
116  /* Pixmap logo_pips_small_pixmap;
117 
118  logo_pips_small_pixmap = XCreatePixmap((Display *) xv_get(main_frame,
119  XV_DISPLAY),
120  (Window) xv_get(main_frame,
121  XV_ID),
122  */
124  (Server_image) xv_create(NULL, SERVER_IMAGE,
125  /*SERVER_IMAGE_PIXMAP,
126  logo_pips_small,
127  SERVER_IMAGE_X_BITS,
128  logo_pips_small,
129  SERVER_IMAGE_DEPTH, 8,
130  XV_WIDTH, 56,
131  XV_HEIGHT, 51,*/
132  SERVER_IMAGE_X_BITS,
133  logo_pips_small_bits,
134  XV_WIDTH, logo_pips_small_width,
135  XV_HEIGHT, logo_pips_small_height,
136  NULL);
137 
138  inverted_pips_icon = (char *) malloc(sizeof(logo_pips_small_bits));
139  for (i = 0; i < sizeof(logo_pips_small_bits); i++)
140  inverted_pips_icon[i] = ~logo_pips_small_bits[i];
142  (Server_image) xv_create(NULL, SERVER_IMAGE,
143  SERVER_IMAGE_X_BITS,
144  inverted_pips_icon,
145  XV_WIDTH, logo_pips_small_width,
146  XV_HEIGHT, logo_pips_small_height,
147  NULL);
148  free(inverted_pips_icon);
149 
151 }
void * malloc(YYSIZE_T)
void free(void *)
Server_image wpips_positive_server_image
To store the negative image for a blinking icon in the interrupt button:
Definition: xv_icons.c:46
Server_image wpips_negative_server_image
Definition: xv_icons.c:46

References free(), malloc(), wpips_negative_server_image, and wpips_positive_server_image.

+ Here is the call graph for this function:

◆ set_pips_icon()

void set_pips_icon ( Frame  frame,
char *  icon_name,
char *  icon_text 
)

Ok, the icon has been found

Hum... Is there a need to free the old icon ?

Bug if we don't reuse an already existing frame's icon...

fprintf(stderr, "0x%x\n", icon);

If the owner of the icon is not NULL, the behaviour is crazy ! RK, 16/06/94.

If we want to place the icon on the screen : rect.r_width= (int)xv_get(icon, XV_WIDTH); rect.r_height= (int)xv_get(icon, XV_HEIGHT); rect.r_left= 0; rect.r_top= 0;

xv_set(frame, FRAME_ICON, icon, FRAME_CLOSED_RECT, &rect, NULL);

Definition at line 155 of file xv_icons.c.

158 {
159  int i;
160  Server_image image = NULL;
161 
162  for (i = 0; i < LAST_ICON; i++) {
163  if (strcmp(icon_name, pips_icons_data[i].name) == 0) {
165  break;
166  }
167  }
168  if (image != NULL) {
169  /* Ok, the icon has been found */
170  Icon icon;
171  Rect image_rect, label_rect;
172  int height, width;
173 
174  width = xv_get(image, XV_WIDTH);
175  height = xv_get(image, XV_HEIGHT);
176 
177  rect_construct(&image_rect, 0, 0, width, height);
178  rect_construct(&label_rect, 0, height + 5, width, ICON_TEXT_HEIGHT);
179 
180  /* Hum... Is there a need to free the old icon ? */
181  /* Bug if we don't reuse an already existing frame's icon... */
182  icon = (Icon) xv_get(frame, FRAME_ICON);
183  /* fprintf(stderr, "0x%x\n", icon); */
184  if (icon != NULL) {
185  /* If the owner of the icon is not NULL, the behaviour is crazy !
186  RK, 16/06/94. */
187  xv_set(icon,
188  ICON_IMAGE, image,
189  XV_WIDTH, width,
190  XV_HEIGHT, height + ICON_TEXT_HEIGHT,
191  ICON_IMAGE_RECT, &image_rect,
192  ICON_LABEL, icon_text,
193  ICON_LABEL_RECT, &label_rect,
194  NULL);
195  }
196  else {
197  icon = (Icon) xv_create(NULL, ICON,
198  ICON_IMAGE, image,
199  XV_WIDTH, width,
200  XV_HEIGHT, height + ICON_TEXT_HEIGHT,
201  ICON_IMAGE_RECT, &image_rect,
202  ICON_LABEL, icon_text,
203  ICON_LABEL_RECT, &label_rect,
204  NULL);
205 
206  xv_set(frame, FRAME_ICON, icon,
207  NULL);
208  }
209  /* If we want to place the icon on the screen :
210  rect.r_width= (int)xv_get(icon, XV_WIDTH);
211  rect.r_height= (int)xv_get(icon, XV_HEIGHT);
212  rect.r_left= 0;
213  rect.r_top= 0;
214 
215  xv_set(frame, FRAME_ICON, icon,
216  FRAME_CLOSED_RECT, &rect,
217  NULL);
218  */
219  }
220 }
code taken from http://fast-edge.googlecode.com and adapted to c99
Definition: erode_dilate.c:33

References ICON_TEXT_HEIGHT, LAST_ICON, pips_icon_server_image, and pips_icons_data.

Variable Documentation

◆ pips_icon_server_image

Server_image pips_icon_server_image[LAST_ICON]
static

Definition at line 51 of file xv_icons.c.

Referenced by create_icons(), and set_pips_icon().

◆ pips_icons_data

pips_icons_type pips_icons_data[LAST_ICON]
static
Initial value:
= {
{
"pips", {
}}, {
"ICFG", {
}}, {
"WP65_PE", {
}}, {
"WP65_bank", {
}}, {
"callgraph", {
}}, {
"parallel", {
}}, {
"sequential", {
}}, {
"user", {
}}
}

Definition at line 59 of file xv_icons.c.

Referenced by create_icons(), and set_pips_icon().

◆ wpips_negative_server_image

Server_image wpips_negative_server_image

Definition at line 49 of file xv_icons.c.

◆ wpips_positive_server_image

Server_image wpips_positive_server_image

To store the negative image for a blinking icon in the interrupt button:

Definition at line 48 of file xv_icons.c.