X11 Work Bench Toolkit  1.0
child_frame.h
Go to the documentation of this file.
1 
2 // //
3 // _ _ _ _ __ _ //
4 // ___| |__ (_) | __| | / _|_ __ __ _ _ __ ___ ___ | |__ //
5 // / __| '_ \| | |/ _` | | |_| '__/ _` | '_ ` _ \ / _ \ | '_ \ //
6 // | (__| | | | | | (_| | | _| | | (_| | | | | | | __/_| | | | //
7 // \___|_| |_|_|_|\__,_|___|_| |_| \__,_|_| |_| |_|\___(_)_| |_| //
8 // |_____| //
9 // //
10 // a window that exists as a tab in a frame window //
11 // //
12 // (part of the 'frame window' support API) //
13 // //
15 
16 /*****************************************************************************
17 
18  X11workbench - X11 programmer's 'work bench' application and toolkit
19  Copyright (c) 2010-2016 by Bob Frazier (aka 'Big Bad Bombastic Bob')
20  all rights reserved
21 
22  DISCLAIMER: The X11workbench application and toolkit software are supplied
23  'as-is', with no warranties, either implied or explicit.
24  Any claims to alleged functionality or features should be
25  considered 'preliminary', and might not function as advertised.
26 
27  BSD-like license:
28 
29  There is no restriction as to what you can do with this software, so long
30  as you include the above copyright notice and DISCLAIMER for any distributed
31  work that is equal to or derived from this one, along with this paragraph
32  that explains the terms of the license if the source is also being made
33  available. A "derived work" describes a work that uses a significant portion
34  of the source files or algorithms that are included with this one.
35  Specifically excluded from this are files that were generated by the software,
36  or anything that is included with the software that is part of another package
37  (such as files that were created or added during the 'configure' process).
38  Specifically included is the use of part or all of any of the X11 workbench
39  toolkit source or header files in your distributed application. If you do not
40  ship the source, the above copyright statement is still required to be placed
41  in a reasonably prominent place, such as documentation, splash screens, and/or
42  'about the application' dialog boxes.
43 
44  Use and distribution are in accordance with GPL, LGPL, and/or the above
45  BSD-like license. See COPYING and README files for more information.
46 
47 
48  Additional information at http://sourceforge.net/projects/X11workbench
49 
50 ******************************************************************************/
51 
52 
53 #ifndef _CHILD_FRAME_H_INCLUDED_
54 #define _CHILD_FRAME_H_INCLUDED_
55 
56 #include "text_object.h"
57 #include "frame_window.h"
58 
59 
84 #ifdef __cplusplus
85 extern "C" {
86 #endif // __cplusplus
87 
88 
89 // SEE frame_window.h for WBChildFrame definition
90 
94 #define CHILD_FRAME_TAG (*((const unsigned int * const)"FWCF"))
95 
99 #define CHILD_FRAME_UI_TAG ((WB_UINT32)'F' | ((WB_UINT32)'W' << 8) | ((WB_UINT32)'C' << 16) | ((WB_UINT32)'U' << 24)) /* FWCU */
100 
105 #define FW_FILE_NEW_MENU "IDM_FILE_NEW"
106 #define FW_FILE_CLOSE_MENU "IDM_FILE_CLOSE"
107 #define FW_FILE_OPEN_MENU "IDM_FILE_OPEN"
108 #define FW_FILE_SAVE_MENU "IDM_FILE_SAVE"
109 #define FW_FILE_SAVE_AS_MENU "IDM_FILE_SAVE_AS"
110 #define FW_FILE_SAVE_ALL_MENU "IDM_FILE_SAVE_ALL"
112 #define FW_EDIT_CUT_MENU "IDM_EDIT_CUT"
113 #define FW_EDIT_COPY_MENU "IDM_EDIT_COPY"
114 #define FW_EDIT_PASTE_MENU "IDM_EDIT_PASTE"
115 #define FW_EDIT_DELETE_MENU "IDM_EDIT_DELETE"
116 #define FW_EDIT_SELECT_ALL_MENU "IDM_EDIT_SELECT_ALL"
117 #define FW_EDIT_SELECT_NONE_MENU "IDM_EDIT_SELECT_NONE"
119 #define FW_FILE_NEW_ACCEL "Ctrl+N"
120 #define FW_FILE_CLOSE_ACCEL "Ctrl+F4"
121 #define FW_FILE_OPEN_ACCEL "Ctrl+O"
122 #define FW_FILE_SAVE_ACCEL "Ctrl+S"
123 #define FW_FILE_SAVE_AS_ACCEL "Ctrl+Shift+S"
124 #define FW_FILE_SAVE_ALL_ACCEL "Ctrl+Shift+L"
126 #define FW_EDIT_CUT_ACCEL "Ctrl+X"
127 #define FW_EDIT_COPY_ACCEL "Ctrl+C"
128 #define FW_EDIT_PASTE_ACCEL "Ctrl+V"
129 #define FW_EDIT_SELECT_ALL_ACCEL "Ctrl+A"
130 #define FW_EDIT_SELECT_NONE_ACCEL "Ctrl+Shift+A"
170 int FWInitChildFrame(WBChildFrame *pChildFrame, WBFrameWindow *pOwner, XFontSet rFontSet,
171  const char *szFocusMenu, const WBFWMenuHandler *pHandlerArray,
172  WBWinEvent pUserCallback, int fFlags);
173 
184 void FWDestroyChildFrame(WBChildFrame *pChildFrame);
185 
197 void FWSetChildFrameMenu(WBChildFrame *pChildFrame, const char *szFocusMenu);
198 
210 void FWSetChildFrameMenuHandlers(WBChildFrame *pChildFrame, const WBFWMenuHandler *pHandlerArray);
211 
223 void FWSetChildFrameDisplayName(WBChildFrame *pChildFrame, const char *szDisplayName);
224 
238 void FWSetChildFrameImageAtom(WBChildFrame *pChildFrame, Atom aImage);
239 
256 void FWSetChildFrameExtent(WBChildFrame *pChildFrame, int iXExtent, int iYExtent);
257 
258 
276 void FWSetChildFrameScrollInfo(WBChildFrame *pChildFrame, int iRow, int iMaxRow, int iCol, int iMaxCol,
277  int iRowHeight, int iColWidth);
278 
279 
295 void FWChildFrameRecalcLayout(WBChildFrame *pChildFrame);
296 
297 
311 void FWChildFrameStatusChanged(WBChildFrame *pChildFrame);
312 
328 int FWChildFrameQueryClose(WBChildFrame *pChildFrame);
329 
330 
342 int FWChildFrameEvent(Window wID, XEvent *pEvent);
343 
344 
355 static __inline__ WBChildFrame *FWGetChildFrameStruct(Window wID)
356 {
357  WBChildFrame *pRval = (WBChildFrame *)WBGetWindowData(wID, 0); // offset 0 for window-specific structs
358  if(pRval && pRval->ulTag == CHILD_FRAME_TAG)
359  {
360  return(pRval);
361  }
362 
363  return(NULL);
364 }
365 
366 
367 
368 #ifdef __cplusplus
369 };
370 #endif // __cplusplus
371 
372 #endif // _CHILD_FRAME_H_INCLUDED_
373