oleview: Fix compilation with gcc 2.95.
[wine] / programs / oleview / main.h
1 /*
2  * OleView (main.h)
3  *
4  * Copyright 2006 Piotr Caban
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #define COBJMACROS
22
23 #ifdef NONAMELESSUNION
24 # define U(x)  (x).u
25 #else
26 # define U(x)  (x)
27 #endif
28
29 #include <windows.h>
30 #include <winreg.h>
31 #include <commctrl.h>
32 #include <unknwn.h>
33
34 #include "resource.h"
35
36 #define MAX_LOAD_STRING 256
37 #define MAX_WINDOW_WIDTH 30000
38
39 #define STATUS_WINDOW 2000
40 #define TREE_WINDOW 2001
41 #define TAB_WINDOW 2002
42
43 /*ItemInfo flags */
44 #define REGTOP 1
45 #define REGPATH 2
46 #define SHOWALL 4
47 #define INTERFACE 8
48
49 typedef struct
50 {
51     HWND hMainWnd;
52     HWND hPaneWnd;
53     HWND hStatusBar;
54     HWND hToolBar;
55     HWND hTree;
56     HWND hDetails;
57     HINSTANCE hMainInst;
58     BOOL bExpert;
59     DWORD dwClsCtx;
60     WCHAR wszMachineName[MAX_LOAD_STRING];
61 }GLOBALS;
62
63 typedef struct
64 {
65     HWND left;
66     HWND right;
67     INT pos;
68     INT size;
69     INT width;
70     INT height;
71     INT last;
72 }PANE;
73
74 typedef struct
75 {
76     /* Main TreeView entries: */
77     HTREEITEM hOC;    /* Object Classes */
78     HTREEITEM hGBCC;  /* Grouped by Component Category */
79     HTREEITEM hO1O;   /* OLE 1.0 Objects */
80     HTREEITEM hCLO;   /* COM Library Objects */
81     HTREEITEM hAO;    /* All Objects */
82     HTREEITEM hAID;   /* Application IDs */
83     HTREEITEM hTL;    /* Type Libraries */
84     HTREEITEM hI;     /* Interfaces */
85 }TREE;
86
87 typedef struct
88 {
89     CHAR cFlag;
90     WCHAR info[MAX_LOAD_STRING];
91     WCHAR clsid[MAX_LOAD_STRING];
92     BOOL loaded;
93     IUnknown *pU;
94 }ITEM_INFO;
95
96 typedef struct
97 {
98     HWND hStatic;
99     HWND hTab;
100     HWND hReg;
101 }DETAILS;
102
103 extern GLOBALS globals;
104 extern TREE tree;
105
106 /* Predefinitions: */
107 /* details.c */
108 HWND CreateDetailsWindow(HINSTANCE hInst);
109 void RefreshDetails(HTREEITEM item);
110
111 /* oleview.c */
112 void RefreshMenu(HTREEITEM item);
113
114 /* pane.c */
115 BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst);
116 void SetLeft(HWND hParent, HWND hWnd);
117 void SetRight(HWND hParent, HWND hWnd);
118
119 /* tree.h */
120 void EmptyTree(void);
121 void AddTreeEx(void);
122 void AddTree(void);
123 HWND CreateTreeWindow(HINSTANCE hInst);
124 BOOL CreateRegPath(HTREEITEM item, WCHAR *buffer, int bufSize);
125 void CreateInst(HTREEITEM item, WCHAR *wszMachineName);
126 void ReleaseInst(HTREEITEM item);
127
128 /* interface.h */
129 BOOL IsInterface(HTREEITEM item);
130 void InterfaceViewer(HTREEITEM item);