File: wl_plug.c

package info (click to toggle)
gwm 1.8d-2
  • links: PTS
  • area: main
  • in suites: potato, woody
  • size: 5,120 kB
  • ctags: 3,030
  • sloc: ansic: 19,617; makefile: 1,763; lisp: 437; sh: 321; ml: 21
file content (82 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (2)
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
/* Copyright 1989 GROUPE BULL -- See license conditions in file COPYRIGHT
 * Copyright 1989 Massachusetts Institute of Technology
 */
/*********************\
* 		      *
*  WOOL_OBJECT: Plug  *
*  BODY		      *
* 		      *
\*********************/

#include "EXTERN.h"
#include <stdio.h>
#include "wool.h"
#include "wl_atom.h"
#include "wl_number.h"
#include "wl_string.h"
#include "gwm.h"
#include "wl_event.h"
#include "wl_fsm.h"
#include "wl_label.h"
#include "INTERN.h"
#include "wl_plug.h"

/*
 * Constructor: wool_plug_make callable from wool
 */

WOOL_Plug
wool_plug_make(label)
WOOL_OBJECT label;
{
    WOOL_Plug       plug = (WOOL_Plug) Malloc(sizeof(struct _WOOL_Plug));

    zrt_put(plug);
    plug -> type = WLPlug;
    plug -> borderwidth = DefaultBorderWidth;
    plug -> borderpixel = Context -> pixel.Border;
    plug -> background = Context -> pixel.Back;
    get_val_from_context(plug -> bordertile, WA_bordertile);
    get_val_from_context(plug -> fsm, WA_fsm);
    get_val_from_context(plug -> menu, WA_menu);
    get_val_from_context(plug -> cursor, WA_cursor);
    get_val_from_context(plug -> property, WA_property);

    fix_fsm(&(plug -> fsm));
    increase_reference(plug -> graphic = label);
    return plug;
}

/*
 * WLPlug_print:
 * PLUG(text)
 */

WOOL_OBJECT
WLPlug_print(obj)
WOOL_Plug       obj;
{
    wool_printf("{PLUG 0x%x: ", obj);
    wool_print(obj -> graphic);
    wool_puts("}");
    return (WOOL_OBJECT) obj;
}

/*
 * WLPlug_free:
 * recursivly free string and fsm
 */

WOOL_OBJECT
WLPlug_free(obj)
WOOL_Plug       obj;
{
    decrease_reference(obj -> bordertile);
    decrease_reference(obj -> menu);
    decrease_reference(obj -> graphic);
    decrease_reference(obj -> fsm);
    decrease_reference(obj -> cursor);
    decrease_reference(obj -> property);
    Free(obj);
    return NULL;
}