PIPS
xv_icons.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "genC.h"
#include "misc.h"
#include <gtk/gtk.h>
#include "gpips.h"
#include "pips.icon"
#include "ICFG.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 40 of file xv_icons.c.

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

Function Documentation

◆ create_icons()

void create_icons ( )

include "logo_pips_small.xpm"

Definition at line 72 of file xv_icons.c.

72  {
73  int i;
74 
75  for (i = 0; i < LAST_ICON; i++) {
76  pips_icon_server_image[i] = (Server_image) xv_create(NULL,
77  SERVER_IMAGE, XV_WIDTH, 64, XV_HEIGHT, 64, SERVER_IMAGE_BITS,
78  &pips_icons_data[i].bitmap[0], NULL);
79  }
80 
81  set_pips_icon(main_frame, "pips", "Wpips");
82 }
@ 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
static pips_icons_type pips_icons_data[LAST_ICON]
Definition: xv_icons.c:55
static Server_image pips_icon_server_image[LAST_ICON]
Definition: xv_icons.c:48
void set_pips_icon(Frame frame, char *icon_name, char *icon_text)
Definition: xv_icons.c:118

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

Referenced by wpips_main().

+ Here is the call graph for this function:
+ Here is the caller 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 84 of file xv_icons.c.

84  {
85  /* To store the negative image for a blinking icon in the interrupt
86  button: */
87  char * inverted_pips_icon;
88  int i;
89  /* Pixmap logo_pips_small_pixmap;
90 
91  logo_pips_small_pixmap = XCreatePixmap((Display *) xv_get(main_frame,
92  XV_DISPLAY),
93  (Window) xv_get(main_frame,
94  XV_ID),
95  */
96  wpips_positive_server_image = (Server_image) xv_create(NULL, SERVER_IMAGE,
97  /*SERVER_IMAGE_PIXMAP,
98  logo_pips_small,
99  SERVER_IMAGE_X_BITS,
100  logo_pips_small,
101  SERVER_IMAGE_DEPTH, 8,
102  XV_WIDTH, 56,
103  XV_HEIGHT, 51,*/
104  SERVER_IMAGE_X_BITS, logo_pips_small_bits, XV_WIDTH, logo_pips_small_width,
105  XV_HEIGHT, logo_pips_small_height, NULL);
106 
107  inverted_pips_icon = (char *) malloc(sizeof(logo_pips_small_bits));
108  for (i = 0; i < sizeof(logo_pips_small_bits); i++)
109  inverted_pips_icon[i] = ~logo_pips_small_bits[i];
110  wpips_negative_server_image = (Server_image) xv_create(NULL, SERVER_IMAGE,
111  SERVER_IMAGE_X_BITS, inverted_pips_icon, XV_WIDTH,
112  logo_pips_small_width, XV_HEIGHT, logo_pips_small_height, NULL);
113  free(inverted_pips_icon);
114 
116 }
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.

Referenced by create_status_subwindow().

+ Here is the call graph for this function:
+ Here is the caller 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 118 of file xv_icons.c.

118  {
119  int i;
120  Server_image image = NULL;
121 
122  for (i = 0; i < LAST_ICON; i++) {
123  if (strcmp(icon_name, pips_icons_data[i].name) == 0) {
125  break;
126  }
127  }
128  if (image != NULL) {
129  /* Ok, the icon has been found */
130  Icon icon;
131  Rect image_rect, label_rect;
132  int height, width;
133 
134  width = xv_get(image, XV_WIDTH);
135  height = xv_get(image, XV_HEIGHT);
136 
137  rect_construct(&image_rect, 0, 0, width, height);
138  rect_construct(&label_rect, 0, height + 5, width, ICON_TEXT_HEIGHT);
139 
140  /* Hum... Is there a need to free the old icon ? */
141  /* Bug if we don't reuse an already existing frame's icon... */
142  icon = (Icon) xv_get(frame, FRAME_ICON);
143  /* fprintf(stderr, "0x%x\n", icon); */
144  if (icon != NULL) {
145  /* If the owner of the icon is not NULL, the behaviour is crazy !
146  RK, 16/06/94. */
147  xv_set(icon, ICON_IMAGE, image, XV_WIDTH, width, XV_HEIGHT, height
148  + ICON_TEXT_HEIGHT, ICON_IMAGE_RECT, &image_rect,
149  ICON_LABEL, icon_text, ICON_LABEL_RECT, &label_rect, NULL);
150  } else {
151  icon = (Icon) xv_create(NULL, ICON, ICON_IMAGE, image, XV_WIDTH,
152  width, XV_HEIGHT, height + ICON_TEXT_HEIGHT,
153  ICON_IMAGE_RECT, &image_rect, ICON_LABEL, icon_text,
154  ICON_LABEL_RECT, &label_rect, NULL);
155 
156  xv_set(frame, FRAME_ICON, icon, NULL);
157  }
158  /* If we want to place the icon on the screen :
159  rect.r_width= (int)xv_get(icon, XV_WIDTH);
160  rect.r_height= (int)xv_get(icon, XV_HEIGHT);
161  rect.r_left= 0;
162  rect.r_top= 0;
163 
164  xv_set(frame, FRAME_ICON, icon,
165  FRAME_CLOSED_RECT, &rect,
166  NULL);
167  */
168  }
169 }
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.

Referenced by create_icons(), wpips_file_view(), and wpips_view_marked_busy().

+ Here is the caller graph for this function:

Variable Documentation

◆ pips_icon_server_image

Server_image pips_icon_server_image[LAST_ICON]
static

Definition at line 48 of file xv_icons.c.

Referenced by create_icons(), create_status_subwindow(), and set_pips_icon().

◆ pips_icons_data

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

Definition at line 55 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 46 of file xv_icons.c.

Referenced by create_status_window_pips_image(), and wpips_interrupt_button_blink().

◆ 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 46 of file xv_icons.c.

Referenced by create_status_window_pips_image(), wpips_interrupt_button_blink(), and wpips_interrupt_button_restore().