summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/gtkint.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/wlib/gtklib/gtkint.h')
-rw-r--r--app/wlib/gtklib/gtkint.h263
1 files changed, 188 insertions, 75 deletions
diff --git a/app/wlib/gtklib/gtkint.h b/app/wlib/gtklib/gtkint.h
index c27c70b..da0d9ae 100644
--- a/app/wlib/gtklib/gtkint.h
+++ b/app/wlib/gtklib/gtkint.h
@@ -1,5 +1,5 @@
-/*
- * $Header: /home/dmarkle/xtrkcad-fork-cvs/xtrkcad/app/wlib/gtklib/gtkint.h,v 1.8 2009-12-12 17:16:08 m_fischer Exp $
+/** \file gtkint.h
+ * Internal definitions for the gtk-library
*/
/* XTrkCad - Model Railroad CAD
@@ -27,7 +27,6 @@
#include "gdk/gdk.h"
#include "gtk/gtk.h"
-#define EXPORT
#ifdef WINDOWS
#define strcasecmp _stricmp
@@ -35,6 +34,10 @@
#include "dynarr.h"
+#define BORDERSIZE (4)
+#define LABEL_OFFSET (3)
+#define MENUH (24)
+
extern wWin_p gtkMainW;
typedef enum {
@@ -84,6 +87,37 @@ struct wWin_t {
struct wControl_t {
WOBJ_COMMON
};
+
+typedef struct wListItem_t * wListItem_p;
+
+struct wList_t {
+ WOBJ_COMMON
+// GtkWidget *list;
+ int count;
+ int number;
+ int colCnt;
+ wPos_t *colWidths;
+ wBool_t *colRightJust;
+ GtkListStore *listStore;
+ GtkWidget *treeView;
+ int last;
+ wPos_t listX;
+ long * valueP;
+ wListCallBack_p action;
+ int recursion;
+ int editted;
+ int editable;
+ };
+
+
+struct wListItem_t {
+ wBool_t active;
+ void * itemData;
+ const char * label;
+ GtkLabel * labelG;
+ wBool_t selected;
+ wList_p listP;
+ };
#define gtkIcon_bitmap (1)
#define gtkIcon_pixmap (2)
@@ -95,83 +129,118 @@ struct wIcon_t {
const void * bits;
};
-extern char wAppName[];
extern char wConfigName[];
extern wDrawColor wDrawColorWhite;
extern wDrawColor wDrawColorBlack;
-/* gtkmisc.c */
-void * gtkAlloc( wWin_p, wType_e, wPos_t, wPos_t, const char *, int, void * );
-void gtkComputePos( wControl_p );
-void gtkAddButton( wControl_p );
-int gtkAddLabel( wControl_p, const char * );
-void gtkControlGetSize( wControl_p );
-struct accelData_t;
-struct accelData_t * gtkFindAccelKey( GdkEventKey * event );
-wBool_t gtkHandleAccelKey( GdkEventKey * );
-wBool_t catch_shift_ctrl_alt_keys( GtkWidget *, GdkEventKey *, void * );
-void gtkSetReadonly( wControl_p, wBool_t );
-wControl_p gtkGetControlFromPos( wWin_p, wPos_t, wPos_t );
-void gtkSetTrigger( wControl_p, setTriggerCallback_p );
-GdkPixmap * gtkMakeIcon( GtkWidget *, wIcon_p, GdkBitmap ** );
-char * gtkConvertInput( const char * );
-char * gtkConvertOutput( const char * );
-
-/* gtkwindow.c */
-void gtkDoModal( wWin_p, wBool_t );
-
-/* gtkhelp.c */
-void load_into_view( char *, int );
-void gtkAddHelpString( GtkWidget *, const char * );
-void gtkHelpHideBalloon( void );
-
-/* gtksimple.c */
-void gtkDrawBox( wWin_p, wBoxType_e, wPos_t, wPos_t, wPos_t, wPos_t );
-void gtkLineShow( wLine_p, wBool_t );
-
-/* gktlist.c */
-void gtkListShow( wList_p, wBool_t );
-void gtkListSetPos( wList_p );
-void gtkListActive( wList_p, wBool_t );
-void gtkDropListPos( wList_p );
-
-/* gtktext.c */
-void gtkTextFreeze( wText_p );
-void gtkTextThaw( wText_p );
-
-/* gtkfont.c */
-const char * gtkFontTranslate( wFont_p );
-PangoLayout *gtkFontCreatePangoLayout( GtkWidget *, void *cairo,
- wFont_p, wFontSize_t, const char *,
- int *, int *, int *, int * );
-
-/* gtkbutton.c */
-void gtkButtonDoAction( wButton_p );
-void gtkSetLabel( GtkWidget*, long, const char *, GtkLabel**, GtkWidget** );
-
-/* gtkcolor.c */
-void gtkGetColorMap( void );
-GdkColor * gtkGetColor( wDrawColor, wBool_t );
-int gtkGetColorChar( wDrawColor );
-void gtkPrintColorMap( FILE *, int, int );
-int gtkMapPixel( long );
-
-/* psprint.c */
-
-void WlibApplySettings( GtkPrintOperation *op );
-void WlibSaveSettings( GtkPrintOperation *op );
-
-void psPrintLine( wPos_t, wPos_t, wPos_t, wPos_t,
- wDrawWidth, wDrawLineType_e, wDrawColor, wDrawOpts );
-void psPrintArc( wPos_t, wPos_t, wPos_t, double, double, int,
- wDrawWidth, wDrawLineType_e, wDrawColor, wDrawOpts );
-void psPrintString( wPos_t x, wPos_t y, double a, char * s,
- wFont_p fp, double fs, wDrawColor color, wDrawOpts opts );
-
-void psPrintFillRectangle( wPos_t, wPos_t, wPos_t, wPos_t, wDrawColor, wDrawOpts );
-void psPrintFillPolygon( wPos_t [][2], int, wDrawColor, wDrawOpts );
-void psPrintFillCircle( wPos_t, wPos_t, wPos_t, wDrawColor, wDrawOpts );
+
+/* boxes.c */
+void wlibDrawBox(wWin_p win, wBoxType_e style, wPos_t x, wPos_t y, wPos_t w, wPos_t h);
+
+/* button.c */
+void wlibSetLabel(GtkWidget *widget, long option, const char *labelStr, GtkLabel **labelG, GtkWidget **imageG);
+void wlibButtonDoAction(wButton_p bb);
+
+struct wButton_t {
+ WOBJ_COMMON
+ GtkLabel * labelG;
+ GtkWidget * imageG;
+ wButtonCallBack_p action;
+ int busy;
+ int recursion;
+};
+
+/* color.c */
+typedef struct {
+ unsigned char red;
+ unsigned char green;
+ unsigned char blue;
+ GdkColor normalColor;
+ GdkColor invertColor;
+ long rgb;
+ int colorChar;
+} colorMap_t;
+
+GdkColor *wlibGetColor(wDrawColor color, wBool_t normal);
+
+/* control.c */
+
+/* droplist.c */
+enum columns {
+ LISTCOL_DATA, /**< user data not for display */
+ LISTCOL_BITMAP, /**< bitmap column */
+ LISTCOL_TEXT, /**< starting point for text columns */
+};
+GtkWidget *wlibNewDropList(GtkListStore *ls, int editable);
+
+wIndex_t wDropListGetCount(wList_p b);
+void wDropListClear(wList_p b);
+void *wDropListGetItemContext(wList_p b, wIndex_t inx);
+void wDropListAddValue(wList_p b, char *text, wListItem_p data);
+void wDropListSetIndex(wList_p b, int val);
+wBool_t wDropListSetValues(wList_p b, wIndex_t row, const char *labelStr, wIcon_p bm, void *itemData);
+wList_p wDropListCreate(wWin_p parent, wPos_t x, wPos_t y, const char *helpStr, const char *labelStr, long option, long number, wPos_t width, long *valueP, wListCallBack_p action, void *data);
+
+/* filesel.c */
+
+/* font.c */
+PangoLayout *wlibFontCreatePangoLayout(GtkWidget *widget, void *cairo, wFont_p fp, wFontSize_t fs, const char *s, int *width_p, int *height_p, int *ascent_p, int *descent_p);
+void wlibFontDestroyPangoLayout(PangoLayout *layout);
+const char *wlibFontTranslate(wFont_p fp);
+
+/* help.c */
+
+/* lines.c */
+void wlibLineShow(wLine_p bl, wBool_t visible);
+
+/* list.c */
+int CompareListData(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data);
+
+/* liststore.c */
+wListItem_p wlibListItemGet(GtkListStore *ls, wIndex_t inx, GList **childR);
+void *wlibListStoreGetContext(GtkListStore *ls, int inx);
+void wlibListStoreClear(GtkListStore *listStore);
+GtkListStore *wlibNewListStore(int colCnt);
+void wlibListStoreSetPixbuf(GtkListStore *ls, GtkTreeIter *iter, GdkPixbuf *pixbuf);
+int wlibListStoreAddData(GtkListStore *ls, GdkPixbuf *pixbuf, int cols, wListItem_p id);
+int wlibListStoreUpdateValues(GtkListStore *ls, int row, int cols, char *labels, wIcon_p bm);
+
+/* main.c */
+char *wlibGetAppName(void);
+
+/* menu.c */
+int getMlistOrigin(wMenuList_p ml, GList **pChildren);
+
+/* misc.c */
+typedef struct accelData_t {
+ wAccelKey_e key;
+ int modifier;
+ wAccelKeyCallBack_p action;
+ void * data;
+} accelData_t;
+
+
+GdkPixbuf* wlibPixbufFromXBM(wIcon_p ip);
+int wlibAddLabel(wControl_p b, const char *labelStr);
+void *wlibAlloc(wWin_p parent, wType_e type, wPos_t origX, wPos_t origY, const char *labelStr, int size, void *data);
+void wlibComputePos(wControl_p b);
+void wlibControlGetSize(wControl_p b);
+void wlibAddButton(wControl_p b);
+wControl_p wlibGetControlFromPos(wWin_p win, wPos_t x, wPos_t y);
+char *wlibConvertInput(const char *inString);
+char *wlibConvertOutput(const char *inString);
+struct accelData_t *wlibFindAccelKey(GdkEventKey *event);
+wBool_t wlibHandleAccelKey(GdkEventKey *event);
+
+/* notice.c */
+
+/* pixbuf.c */
+GdkPixbuf *wlibMakePixbuf(wIcon_p ip);
+
+/* png.c */
+
+/* print.c */
struct wDraw_t {
WOBJ_COMMON
void * context;
@@ -199,4 +268,48 @@ struct wDraw_t {
cairo_t *printContext;
cairo_surface_t *curPrintSurface;
};
+
+void WlibApplySettings(GtkPrintOperation *op);
+void WlibSaveSettings(GtkPrintOperation *op);
+void psPrintLine(wPos_t x0, wPos_t y0, wPos_t x1, wPos_t y1, wDrawWidth width, wDrawLineType_e lineType, wDrawColor color, wDrawOpts opts);
+void psPrintArc(wPos_t x0, wPos_t y0, wPos_t r, double angle0, double angle1, wBool_t drawCenter, wDrawWidth width, wDrawLineType_e lineType, wDrawColor color, wDrawOpts opts);
+void psPrintFillRectangle(wPos_t x0, wPos_t y0, wPos_t x1, wPos_t y1, wDrawColor color, wDrawOpts opts);
+void psPrintFillPolygon(wPos_t p[][2], int cnt, wDrawColor color, wDrawOpts opts);
+void psPrintFillCircle(wPos_t x0, wPos_t y0, wPos_t r, wDrawColor color, wDrawOpts opts);
+void psPrintString(wPos_t x, wPos_t y, double a, char *s, wFont_p fp, double fs, wDrawColor color, wDrawOpts opts);
+static void WlibGetPaperSize(void);
+
+/* single.c */
+
+/* splash.c */
+
+/* text.c */
+
+/* timer.c */
+void wlibSetTrigger(wControl_p b, setTriggerCallback_p trigger);
+
+/* tooltip.c */
+#define HELPDATAKEY "HelpDataKey"
+void wlibAddHelpString(GtkWidget *widget, const char *helpStr);
+void wlibHelpHideBalloon();
+
+/* treeview.c */
+void wlibTreeViewSetSelected(wList_p b, int index);
+GtkWidget *wlibNewTreeView(GtkListStore *ls, int showTitles, int multiSelection);
+int wlibTreeViewAddColumns(GtkWidget *tv, int count);
+int wlibAddColumnTitles(GtkWidget *tv, const char **titles);
+int wlibTreeViewAddData(GtkWidget *tv, int cols, char *label, GdkPixbuf *pixbuf, wListItem_p userData);
+void wlibTreeViewAddRow(wList_p b, char *label, wIcon_p bm, wListItem_p id_p);
+gboolean changeSelection(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data);
+
+int wTreeViewGetCount(wList_p b);
+void wTreeViewClear(wList_p b);
+void *wTreeViewGetItemContext(wList_p b, int row);
+
+/* window.c */
+void wlibDoModal(wWin_p win0, wBool_t modal);
+wBool_t catch_shift_ctrl_alt_keys(GtkWidget *widget, GdkEventKey *event, void *data);
+
+/* wpref.c */
+
#endif