File: fwarn.c

package info (click to toggle)
notion 4.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,656 kB
  • sloc: ansic: 47,365; sh: 2,093; makefile: 594; perl: 270
file content (67 lines) | stat: -rw-r--r-- 1,371 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
/*
 * ion/mod_query/query.c
 *
 * Copyright (c) Tuomo Valkonen 1999-2007.
 *
 * See the included file LICENSE for details.
 */


#include <ioncore/common.h>
#include <ioncore/global.h>
#include <ioncore/focus.h>
#include <ioncore/frame.h>
#include <ioncore/stacking.h>
#include <libtu/objp.h>
#include "wmessage.h"
#include "fwarn.h"


/*(internal) EXTL_DOC
 * Display an error message box in the multiplexer \var{mplex}.
 */
EXTL_EXPORT
WMessage *mod_query_do_warn(WMPlex *mplex, const char *p)
{
    char *p2;
    WMessage *wmsg;

    if(p==NULL)
        return NULL;

    p2=scat(TR("Error:\n"), p);

    if(p2==NULL)
        return NULL;

    wmsg=mod_query_do_message(mplex, p2);

    free(p2);

    return wmsg;
}


/*(internal) EXTL_DOC
 * Display a message in the \var{mplex}.
 */
EXTL_EXPORT
WMessage *mod_query_do_message(WMPlex *mplex, const char *p)
{
    WMPlexAttachParams par=MPLEXATTACHPARAMS_INIT;

    if(p==NULL)
        return NULL;

    par.flags=(MPLEX_ATTACH_SWITCHTO|
               MPLEX_ATTACH_LEVEL|
               MPLEX_ATTACH_UNNUMBERED|
               MPLEX_ATTACH_SIZEPOLICY);
    par.szplcy=SIZEPOLICY_FULL_BOUNDS;
    par.level=STACKING_LEVEL_MODAL1+1;

    return (WMessage*)mplex_do_attach_new(mplex, &par,
                                          (WRegionCreateFn*)create_wmsg,
                                          (void*)p);
}