123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $XConsortium: IconP.h /main/7 1996/03/29 11:33:23 drk $ */
- /**---------------------------------------------------------------------
- ***
- *** file: IconP.h
- ***
- *** project: MotifPlus Widgets
- ***
- *** description: Private include file for DtIcon gadget class.
- ***
- ***
- *** (c) Copyright 1990 by Hewlett-Packard Company.
- ***
- ***
- ***-------------------------------------------------------------------*/
- #ifndef _DtIconP_h
- #define _DtIconP_h
- #include <Xm/ExtObjectP.h>
- #include <Xm/XmP.h>
- #include <Xm/GadgetP.h>
- #include <Dt/Icon.h>
- /*-------------------------------------------------------------
- ** Cache Class Structure
- */
- /* Cache Class Part
- */
- typedef struct _DtIconCacheObjClassPart
- {
- int foo;
- } DtIconCacheObjClassPart;
- /* Cache Full Class Record
- */
- typedef struct _DtIconCacheObjClassRec /* label cache class record */
- {
- ObjectClassPart object_class;
- XmExtClassPart ext_class;
- DtIconCacheObjClassPart icon_class_cache;
- } DtIconCacheObjClassRec;
- /* Cache Actual Class
- */
- externalref DtIconCacheObjClassRec dtIconCacheObjClassRec;
- /*-------------------------------------------------------------
- ** Cache Instance Structure
- */
- /* Cache Instance Part
- */
- typedef struct _DtIconCacheObjPart
- {
- Dimension margin_width;
- Dimension margin_height;
- Dimension string_height;
- Dimension spacing;
- Pixel foreground;
- Pixel background;
- Pixel arm_color;
- Boolean fill_on_arm;
- Boolean recompute_size;
- Boolean draw_shadow;
- unsigned char pixmap_position;
- unsigned char string_position;
- unsigned char alignment;
- unsigned char behavior;
- unsigned char fill_mode;
- } DtIconCacheObjPart;
- typedef struct _DtIconCacheObjRec
- {
- ObjectPart object;
- XmExtPart ext;
- DtIconCacheObjPart icon_cache;
- } DtIconCacheObjRec;
- typedef void (*GetPositionProc)(
- DtIconGadget,
- Position,
- Position,
- Dimension,
- Dimension,
- Position *,
- Position *,
- Position *,
- Position *
- );
- typedef void (*GetSizeProc)(
- DtIconGadget,
- Dimension *,
- Dimension *
- );
- typedef void (*DrawProc)(
- DtIconGadget,
- Drawable,
- Position,
- Position,
- Dimension,
- Dimension,
- Dimension,
- Dimension,
- unsigned char,
- unsigned char
- );
- typedef void (*CallCallbackProc)(
- DtIconGadget,
- XtCallbackList,
- int,
- XEvent *
- );
- typedef void (*UpdateGCsProc)(
- DtIconGadget
- );
- /*-------------------------------------------------------------
- ** Class Structure
- */
- /* Class Part
- */
- typedef struct _DtIconClassPart
- {
- GetSizeProc get_size;
- GetPositionProc get_positions;
- DrawProc draw;
- CallCallbackProc call_callback;
- UpdateGCsProc update_gcs;
- Boolean optimize_redraw;
- XmCacheClassPartPtr cache_part;
- caddr_t extension;
- } DtIconClassPart;
- /* Full Class Record
- */
- typedef struct _DtIconClassRec
- {
- RectObjClassPart rect_class;
- XmGadgetClassPart gadget_class;
- DtIconClassPart icon_class;
- } DtIconClassRec;
- /* Actual Class
- */
- externalref DtIconClassRec dtIconClassRec;
- /*-------------------------------------------------------------
- ** Instance Structure
- */
- /* Instance Part
- */
- typedef struct _DtIconPart
- {
- Boolean set;
- Boolean armed;
- Boolean sync;
- Boolean underline;
- unsigned char shadow_type;
- unsigned char border_type;
- XtCallbackList callback;
- XtIntervalId click_timer_id;
- XButtonEvent * click_event;
- String image_name;
- Pixmap pixmap;
- Pixmap mask;
- Pixel pixmap_foreground;
- Pixel pixmap_background;
- Dimension max_pixmap_width;
- Dimension max_pixmap_height;
- XmFontList font_list;
- XmString string;
- Dimension string_width;
- Dimension pixmap_width;
- Dimension pixmap_height;
- GC clip_gc;
- GC normal_gc;
- GC background_gc;
- GC armed_gc;
- GC armed_background_gc;
- GC parent_background_gc;
- Pixel saved_parent_background;
- DtIconCacheObjPart *cache;
- unsigned char operations;
- XtCallbackList drop_callback;
- } DtIconPart;
- /* Full Instance Record
- */
- typedef struct _DtIconRec
- {
- ObjectPart object;
- RectObjPart rectangle;
- XmGadgetPart gadget;
- DtIconPart icon;
- } DtIconRec;
- /*-------------------------------------------------------------
- ** Class and Instance Macros
- */
- /* DtIcon Class Macros
- */
- #define DtInheritGetSize ((GetSizeProc) _XtInherit)
- #define DtInheritGetPositions ((GetPositionProc) _XtInherit)
- #define DtInheritDraw ((DrawProc) _XtInherit)
- #define DtInheritCallCallback ((CallCallbackProc) _XtInherit)
- #define DtInheritUpdateGCs ((UpdateGCsProc) _XtInherit)
- /*** WARNING: These macros are not thread-safe! ***/
- #define C_GetSize(wc) \
- (((DtIconGadgetClass)(wc)) -> icon_class.get_size)
- #define C_GetPositions(wc) \
- (((DtIconGadgetClass)(wc)) -> icon_class.get_positions)
- #define C_Draw(wc) \
- (((DtIconGadgetClass)(wc)) -> icon_class.draw)
- #define C_CallCallback(wc) \
- (((DtIconGadgetClass)(wc)) -> icon_class.call_callback)
- #define C_OptimizeRedraw(wc) \
- (((DtIconGadgetClass)(wc)) -> icon_class.optimize_redraw)
- #define C_UpdateGCs(wc) \
- (((DtIconGadgetClass)(wc)) -> icon_class.update_gcs)
- /* DtIcon Macros
- */
- /*** WARNING: These macros are not thread-safe! ***/
- #define G_GetSize(g,w,h) \
- (((DtIconClassRec *)g -> object.widget_class) -> icon_class.get_size) \
- (g,w,h)
- #define G_GetPositions(g,w,h,h_t,s_t,p_x,p_y,s_x,s_y) \
- (((DtIconClassRec *)g -> object.widget_class) -> icon_class.get_positions) \
- (g,w,h,h_t,s_t,p_x,p_y,s_x,s_y)
- #define G_Draw(g,d,x,y,w,h,h_t,s_t,s_type,fill) \
- (((DtIconClassRec *)g -> object.widget_class) -> icon_class.draw) \
- (g,d,x,y,w,h,h_t,s_t,s_type,fill)
- #define G_CallCallback(g,cb,r,e) \
- (((DtIconClassRec *)g -> object.widget_class) -> icon_class.call_callback) \
- (g,cb,r,e)
- #define G_UpdateGCs(g) \
- (((DtIconClassRec *)g -> object.widget_class) -> icon_class.update_gcs) \
- (g)
- /* Cached Instance Field Macros
- */
- #define G_CachePixmapPosition(co) (((DtIconCacheObject)(co)) -> \
- icon_cache.pixmap_position)
- #define G_FillOnArm(g) (((DtIconGadget)(g)) -> \
- icon.cache -> fill_on_arm)
- #define G_RecomputeSize(g) (((DtIconGadget)(g)) -> \
- icon.cache -> recompute_size)
- #define G_DrawShadow(g) (((DtIconGadget)(g)) -> \
- icon.cache -> draw_shadow)
- #define G_PixmapPosition(g) (((DtIconGadget)(g)) -> \
- icon.cache -> pixmap_position)
- #define G_StringPosition(g) (((DtIconGadget)(g)) -> \
- icon.cache -> string_position)
- #define G_Alignment(g) (((DtIconGadget)(g)) -> \
- icon.cache -> alignment)
- #define G_Behavior(g) (((DtIconGadget)(g)) -> \
- icon.cache -> behavior)
- #define G_FillMode(g) (((DtIconGadget)(g)) -> \
- icon.cache -> fill_mode)
- #define G_MarginWidth(g) (((DtIconGadget)(g)) -> \
- icon.cache -> margin_width)
- #define G_MarginHeight(g) (((DtIconGadget)(g)) -> \
- icon.cache -> margin_height)
- #define G_StringHeight(g) (((DtIconGadget)(g)) -> \
- icon.cache -> string_height)
- #define G_Spacing(g) (((DtIconGadget)(g)) -> \
- icon.cache -> spacing)
- #define G_Foreground(g) (((DtIconGadget)(g)) -> \
- icon.cache -> foreground)
- #define G_Background(g) (((DtIconGadget)(g)) -> \
- icon.cache -> background)
- #define G_ArmColor(g) (((DtIconGadget)(g)) -> \
- icon.cache -> arm_color)
- /* Non-Cached Instance Field Macros
- */
- #define G_Armed(g) (g -> icon.armed)
- #define G_Set(g) (g -> icon.set)
- #define G_Sync(g) (g -> icon.sync)
- #define G_Callback(g) (g -> icon.callback)
- #define G_ClickTimerID(g) (g -> icon.click_timer_id)
- #define G_ClickInterval(g) (g -> icon.click_interval)
- #define G_ClickEvent(g) (g -> icon.click_event)
- #define G_ShadowType(g) (g -> icon.shadow_type)
- #define G_BorderType(g) (g -> icon.border_type)
- #define G_Pixmap(g) (g -> icon.pixmap)
- #define G_Mask(g) (g -> icon.mask)
- #define G_PixmapForeground(g) (g -> icon.pixmap_foreground)
- #define G_PixmapBackground(g) (g -> icon.pixmap_background)
- #define G_MaxPixmapWidth(g) (g -> icon.max_pixmap_width)
- #define G_MaxPixmapHeight(g) (g -> icon.max_pixmap_height)
- #define G_String(g) (g -> icon.string)
- #define G_FontList(g) (g -> icon.font_list)
- #define G_ImageName(g) (g -> icon.image_name)
- #define G_StringWidth(g) (g -> icon.string_width)
- #define G_PixmapWidth(g) (g -> icon.pixmap_width)
- #define G_PixmapHeight(g) (g -> icon.pixmap_height)
- #define G_BackgroundGC(g) (g -> icon.background_gc)
- #define G_ArmedGC(g) (g -> icon.armed_gc)
- #define G_ArmedBackgroundGC(g) (g -> icon.armed_background_gc)
- #define G_NormalGC(g) (g -> icon.normal_gc)
- #define G_ClipGC(g) (g -> icon.clip_gc)
- #define G_Underline(g) (g -> icon.underline)
- #define G_ParentBackgroundGC(g) (g -> icon.parent_background_gc)
- #define G_SavedParentBG(g) (g -> icon.saved_parent_background)
- #define G_Operations(g) (g -> icon.operations)
- #define G_DropCallback(g) (g -> icon.drop_callback)
- #define Icon_Cache(w) (((DtIconGadget)(w))-> \
- icon.cache)
- #define Icon_ClassCachePart(w) \
- (((DtIconGadgetClass)dtIconGadgetClass)->gadget_class.cache_part)
- #endif /* _DtIconP_h */
- /* DON'T ADD ANYTHING AFTER THIS #endif */
|