Commit 80e6a41f authored by claes's avatar claes

New bitmaps

parent a29eb6e4
/* /*
* Proview $Id: ge_subpalette.cpp,v 1.5 2005-09-01 14:57:53 claes Exp $ * Proview $Id: ge_subpalette.cpp,v 1.6 2005-12-06 10:46:44 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -106,6 +106,51 @@ extern "C" { ...@@ -106,6 +106,51 @@ extern "C" {
#include "ge_bitmap_value50.h" #include "ge_bitmap_value50.h"
#include "ge_bitmap_value51.h" #include "ge_bitmap_value51.h"
#include "ge_bitmap_value52.h" #include "ge_bitmap_value52.h"
#include "ge_bitmap_valve53.h"
#include "ge_bitmap_directvalve54.h"
#include "ge_bitmap_mvalve55.h"
#include "ge_bitmap_basevalve56.h"
#include "ge_bitmap_actuator57.h"
#include "ge_bitmap_handwheel58.h"
#include "ge_bitmap_burner59.h"
#include "ge_bitmap_contactor60.h"
#include "ge_bitmap_contactor61.h"
#include "ge_bitmap_controlswitch62.h"
#include "ge_bitmap_fuse63.h"
#include "ge_bitmap_fuse64.h"
#include "ge_bitmap_motor65.h"
#include "ge_bitmap_overloadrelay66.h"
#include "ge_bitmap_rod67.h"
#include "ge_bitmap_rodcoupling68.h"
#include "ge_bitmap_fan69.h"
#include "ge_bitmap_fan70.h"
#include "ge_bitmap_fan71.h"
#include "ge_bitmap_pump72.h"
#include "ge_bitmap_pump73.h"
#include "ge_bitmap_manswitch74.h"
#include "ge_bitmap_manswitch75.h"
#include "ge_bitmap_manswitch76.h"
#include "ge_bitmap_frequencyconv77.h"
#include "ge_bitmap_slider78.h"
#include "ge_bitmap_smiley79.h"
#include "ge_bitmap_sliderbg80.h"
#include "ge_bitmap_slider81.h"
#include "ge_bitmap_sliderbg82.h"
#include "ge_bitmap_button83.h"
#include "ge_bitmap_button84.h"
#include "ge_bitmap_button85.h"
#include "ge_bitmap_button86.h"
#include "ge_bitmap_button87.h"
#include "ge_bitmap_checkbox88.h"
#include "ge_bitmap_radiobutton89.h"
#include "ge_bitmap_radiobutton90.h"
#include "ge_bitmap_checkbox91.h"
#include "ge_bitmap_button92.h"
#include "ge_bitmap_buttoninfo93.h"
#include "ge_bitmap_buttonhelp94.h"
#include "ge_bitmap_button95.h"
#include "ge_bitmap_notebutton96.h"
#include "ge_bitmap_pump97.h"
#define SUBPALETTE__INPUT_SYNTAX 2 #define SUBPALETTE__INPUT_SYNTAX 2
#define SUBPALETTE__OBJNOTFOUND 4 #define SUBPALETTE__OBJNOTFOUND 4
...@@ -133,10 +178,8 @@ void SubPaletteBrow::free_pixmaps() ...@@ -133,10 +178,8 @@ void SubPaletteBrow::free_pixmaps()
brow_FreeAnnotPixmap( ctx, pixmap_leaf); brow_FreeAnnotPixmap( ctx, pixmap_leaf);
brow_FreeAnnotPixmap( ctx, pixmap_map); brow_FreeAnnotPixmap( ctx, pixmap_map);
brow_FreeAnnotPixmap( ctx, pixmap_openmap); brow_FreeAnnotPixmap( ctx, pixmap_openmap);
for ( int i = 0; i < SUBP_PIXMAPS_SIZE; i++) for ( int i = 0; i < SUBP_PIXMAPS_SIZE - 1; i++) {
{ if ( pixmaps[i])
if ( !pixmaps[i])
break;
brow_FreeAnnotPixmap( ctx, pixmaps[i]); brow_FreeAnnotPixmap( ctx, pixmaps[i]);
} }
} }
...@@ -151,15 +194,16 @@ void SubPaletteBrow::free_pixmaps() ...@@ -151,15 +194,16 @@ void SubPaletteBrow::free_pixmaps()
pixmap_data[i].height = bitmap ## _height; \ pixmap_data[i].height = bitmap ## _height; \
pixmap_data[i].bits = (char *) bitmap ## _bits; \ pixmap_data[i].bits = (char *) bitmap ## _bits; \
} \ } \
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmaps[idx]); if ( idx-1 >= SUBP_PIXMAPS_SIZE) \
return; \
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmaps[idx-1]);
void SubPaletteBrow::allocate_pixmaps() void SubPaletteBrow::allocate_pixmaps()
{ {
flow_sPixmapData pixmap_data; flow_sPixmapData pixmap_data;
int i; int i;
for ( i = 0; i < 9; i++) for ( i = 0; i < 9; i++) {
{
pixmap_data[i].width =xnav_bitmap_leaf12_width; pixmap_data[i].width =xnav_bitmap_leaf12_width;
pixmap_data[i].height =xnav_bitmap_leaf12_height; pixmap_data[i].height =xnav_bitmap_leaf12_height;
pixmap_data[i].bits =xnav_bitmap_leaf12_bits; pixmap_data[i].bits =xnav_bitmap_leaf12_bits;
...@@ -167,8 +211,7 @@ void SubPaletteBrow::allocate_pixmaps() ...@@ -167,8 +211,7 @@ void SubPaletteBrow::allocate_pixmaps()
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_leaf); brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_leaf);
for ( i = 0; i < 9; i++) for ( i = 0; i < 9; i++) {
{
pixmap_data[i].width =xnav_bitmap_map12_width; pixmap_data[i].width =xnav_bitmap_map12_width;
pixmap_data[i].height =xnav_bitmap_map12_height; pixmap_data[i].height =xnav_bitmap_map12_height;
pixmap_data[i].bits =xnav_bitmap_map12_bits; pixmap_data[i].bits =xnav_bitmap_map12_bits;
...@@ -176,8 +219,7 @@ void SubPaletteBrow::allocate_pixmaps() ...@@ -176,8 +219,7 @@ void SubPaletteBrow::allocate_pixmaps()
brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_map); brow_AllocAnnotPixmap( ctx, &pixmap_data, &pixmap_map);
for ( i = 0; i < 9; i++) for ( i = 0; i < 9; i++) {
{
pixmap_data[i].width =xnav_bitmap_openmap12_width; pixmap_data[i].width =xnav_bitmap_openmap12_width;
pixmap_data[i].height =xnav_bitmap_openmap12_height; pixmap_data[i].height =xnav_bitmap_openmap12_height;
pixmap_data[i].bits =xnav_bitmap_openmap12_bits; pixmap_data[i].bits =xnav_bitmap_openmap12_bits;
...@@ -236,6 +278,51 @@ void SubPaletteBrow::allocate_pixmaps() ...@@ -236,6 +278,51 @@ void SubPaletteBrow::allocate_pixmaps()
ALLOC_PIXMAP( ge_bitmap_value50, 50); ALLOC_PIXMAP( ge_bitmap_value50, 50);
ALLOC_PIXMAP( ge_bitmap_value51, 51); ALLOC_PIXMAP( ge_bitmap_value51, 51);
ALLOC_PIXMAP( ge_bitmap_value52, 52); ALLOC_PIXMAP( ge_bitmap_value52, 52);
ALLOC_PIXMAP( ge_bitmap_valve53, 53);
ALLOC_PIXMAP( ge_bitmap_directvalve54, 54);
ALLOC_PIXMAP( ge_bitmap_mvalve55, 55);
ALLOC_PIXMAP( ge_bitmap_basevalve56, 56);
ALLOC_PIXMAP( ge_bitmap_actuator57, 57);
ALLOC_PIXMAP( ge_bitmap_handwheel58, 58);
ALLOC_PIXMAP( ge_bitmap_burner59, 59);
ALLOC_PIXMAP( ge_bitmap_contactor60, 60);
ALLOC_PIXMAP( ge_bitmap_contactor61, 61);
ALLOC_PIXMAP( ge_bitmap_controlswitch62, 62);
ALLOC_PIXMAP( ge_bitmap_fuse63, 63);
ALLOC_PIXMAP( ge_bitmap_fuse64, 64);
ALLOC_PIXMAP( ge_bitmap_motor65, 65);
ALLOC_PIXMAP( ge_bitmap_overloadrelay66, 66);
ALLOC_PIXMAP( ge_bitmap_rod67, 67);
ALLOC_PIXMAP( ge_bitmap_rodcoupling68, 68);
ALLOC_PIXMAP( ge_bitmap_fan69, 69);
ALLOC_PIXMAP( ge_bitmap_fan70, 70);
ALLOC_PIXMAP( ge_bitmap_fan71, 71);
ALLOC_PIXMAP( ge_bitmap_pump72, 72);
ALLOC_PIXMAP( ge_bitmap_pump73, 73);
ALLOC_PIXMAP( ge_bitmap_manswitch74, 74);
ALLOC_PIXMAP( ge_bitmap_manswitch75, 75);
ALLOC_PIXMAP( ge_bitmap_manswitch76, 76);
ALLOC_PIXMAP( ge_bitmap_frequencyconv77, 77);
ALLOC_PIXMAP( ge_bitmap_slider78, 78);
ALLOC_PIXMAP( ge_bitmap_smiley79, 79);
ALLOC_PIXMAP( ge_bitmap_sliderbg80, 80);
ALLOC_PIXMAP( ge_bitmap_slider81, 81);
ALLOC_PIXMAP( ge_bitmap_sliderbg82, 82);
ALLOC_PIXMAP( ge_bitmap_button83, 83);
ALLOC_PIXMAP( ge_bitmap_button84, 84);
ALLOC_PIXMAP( ge_bitmap_button85, 85);
ALLOC_PIXMAP( ge_bitmap_button86, 86);
ALLOC_PIXMAP( ge_bitmap_button87, 87);
ALLOC_PIXMAP( ge_bitmap_checkbox88, 88);
ALLOC_PIXMAP( ge_bitmap_radiobutton89, 89);
ALLOC_PIXMAP( ge_bitmap_radiobutton90, 90);
ALLOC_PIXMAP( ge_bitmap_checkbox91, 91);
ALLOC_PIXMAP( ge_bitmap_button92, 92);
ALLOC_PIXMAP( ge_bitmap_buttoninfo93, 93);
ALLOC_PIXMAP( ge_bitmap_buttonhelp94, 94);
ALLOC_PIXMAP( ge_bitmap_button95, 95);
ALLOC_PIXMAP( ge_bitmap_notebutton96, 96);
ALLOC_PIXMAP( ge_bitmap_pump97, 97);
} }
...@@ -986,8 +1073,9 @@ ItemFile::ItemFile( SubPalette *subpalette, ...@@ -986,8 +1073,9 @@ ItemFile::ItemFile( SubPalette *subpalette,
dest, dest_code, (void *) this, 1, &node); dest, dest_code, (void *) this, 1, &node);
brow_SetAnnotPixmap( node, 0, subpalette->brow->pixmap_leaf); brow_SetAnnotPixmap( node, 0, subpalette->brow->pixmap_leaf);
if ( subpalette->brow->pixmaps[pixmap]) if ( 0 <= (pixmap-1) && (pixmap-1) < SUBP_PIXMAPS_SIZE &&
brow_SetAnnotPixmap( node, 1, subpalette->brow->pixmaps[pixmap]); subpalette->brow->pixmaps[pixmap-1])
brow_SetAnnotPixmap( node, 1, subpalette->brow->pixmaps[pixmap-1]);
brow_SetAnnotation( node, 0, item_name, strlen(item_name)); brow_SetAnnotation( node, 0, item_name, strlen(item_name));
} }
......
/* /*
* Proview $Id: ge_subpalette.h,v 1.4 2005-09-01 14:57:53 claes Exp $ * Proview $Id: ge_subpalette.h,v 1.5 2005-12-06 10:46:44 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -40,8 +40,7 @@ extern "C" { ...@@ -40,8 +40,7 @@ extern "C" {
/*! \addtogroup Ge */ /*! \addtogroup Ge */
/*@{*/ /*@{*/
#define subpalette_cVersion "X3.0b" #define SUBP_PIXMAPS_SIZE 100
#define SUBP_PIXMAPS_SIZE 60
typedef struct subpalette_s_Menu { typedef struct subpalette_s_Menu {
char title[80]; char title[80];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment