libyui-ncurses  2.44.1
 All Classes Functions Variables
NCtypes.cc
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: NCtypes.cc
20 
21  Author: Michael Andres <ma@suse.de>
22 
23 /-*/
24 
25 #include <iostream>
26 
27 #define YUILogComponent "ncurses"
28 #include <yui/YUILog.h>
29 #include "NCtypes.h"
30 
31 
32 std::ostream & operator<<( std::ostream & str, NC::ADJUST obj )
33 {
34 #define PRT(a) case NC::a: return str << #a
35 
36  switch ( obj )
37  {
38  PRT( CENTER );
39  PRT( TOP );
40  PRT( BOTTOM );
41  PRT( LEFT );
42  PRT( RIGHT );
43  PRT( TOPLEFT );
44  PRT( TOPRIGHT );
45  PRT( BOTTOMLEFT );
46  PRT( BOTTOMRIGHT );
47  }
48 
49  return str << "NC::ADJUST";
50 
51 #undef PRT
52 }
53 
54 
55 std::ostream & operator<<( std::ostream & str, NC::WState obj )
56 {
57 #define PRT(a) case NC::a: return str << #a
58 
59  switch ( obj )
60  {
61  PRT( WSdumb );
62  PRT( WSnormal );
63  PRT( WSactive );
64  PRT( WSdisabeled );
65  }
66 
67  return str << "NC::WState";
68 
69 #undef PRT
70 }
71