File: ctl_opt.c

package info (click to toggle)
bibview 2.2-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,252 kB
  • ctags: 1,588
  • sloc: ansic: 15,149; yacc: 1,145; makefile: 297; lex: 221; sh: 17
file content (119 lines) | stat: -rw-r--r-- 4,118 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*********************************************************************/
/*  bibView: Administration of BibTeX-Databases                      */
/*           (Verwaltung von BibTeX-Literaturdatenbanken)            */
/*                                                                   */
/*  Module:  ctl_opt.c                                               */
/*                                                                   */
/*             Options Control                                       */
/*             -                                                     */
/*                                                                   */
/*  Author:  Holger Martin,  martinh@informatik.tu-muenchen.de       */
/*           Peter M. Urban, urban@informatik.tu-muenchen.de         */
/*                                                                   */
/*  History:                                                         */
/*    12.08.91  PMU  created                                         */
/*    05.26.92       Version 1.0 released                            */
/*                                                                   */
/*  Copyright 1992 TU MUENCHEN                                       */
/*    See ./Copyright for complete rights and liability information. */
/*                                                                   */
/*********************************************************************/

#define COT_OPT

#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Paned.h>
#include <X11/Xaw/Form.h>
#include <X11/Xaw/Box.h>
#include <X11/Xaw/Command.h>
#include <X11/Xaw/MenuButton.h>
#include <X11/Xaw/SimpleMenu.h>
#include <X11/Xaw/SmeBSB.h>
#include <X11/Xaw/SmeLine.h>
#include "bibview.h"


/* imported global variables */
/* ------------------------- */
extern Widget topLevel;
extern Pixmap chkmarkPixmap;


/* macros and definitions */
/* ---------------------- */


/* local function prototypes */
/* ------------------------- */


/* exported variables */
/* ------------------ */
Boolean optionsStatus[OPT_MAX_OPTION] = {
   FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE 
};


/* local global variables */
/* ---------------------- */


/*********************************************************************/
/* cotOptionIconOnDeskCmd:                                           */
/*    Callback function for menu entry "icon on desktop"             */
/*********************************************************************/
void 
cotOptionIconOnDeskCmd (Widget w, XtPointer clientData, XtPointer callData)
{
BibPtr bp;
 
   if (optionsStatus[OPT_ICON_ON_DESKTOP]) { 
      /* reset: icons under wm control */
      XtVaSetValues(w, XtNleftBitmap, None, NULL);
      gubUnsetIconCoords(FALSE);
      bp = glbFirstBibListEl();
      while (bp != NULL) {
	 gulUnsetIconCoords(bp, FALSE);
	 gueUnsetIconCoords(bp, FALSE);
	 bp = glbNextBibListEl(bp);
      }  /* endwhile */
   }
   else { 
      /* set: icons under bibview control */
      XtVaSetValues(w, XtNleftBitmap, chkmarkPixmap, NULL);
      gubSetWindowCoords(TRUE);
      gubSetIconCoords(FALSE);
      bp = glbFirstBibListEl();
      while (bp != NULL) {
	 gulSetIconCoords(bp, FALSE);
	 gueSetIconCoords(bp, FALSE);
	 bp = glbNextBibListEl(bp);
      }  /* endwhile */
   }
   optionsStatus[OPT_ICON_ON_DESKTOP] = !optionsStatus[OPT_ICON_ON_DESKTOP];
}


/*********************************************************************/
/* cotOptionsControl:                                                */
/*    Callback function for all option menu entries                  */
/*********************************************************************/
void 
cotOptionsControl (Widget w, XtPointer client_data, XtPointer call_data)
{
int pane_num = (int) client_data;

   if (optionsStatus[pane_num]) 
      XtVaSetValues(w, 
                XtNleftBitmap, None,
                NULL);
    else 
        XtVaSetValues(w, 
                XtNleftBitmap, chkmarkPixmap,
                NULL);
    optionsStatus[pane_num] = !optionsStatus[pane_num];
}