comparison os2/dw.c @ 47:997e9ed670ef

Fixes for box alignment problem on OS/2, crash in dw_bitmap_new() on unix with certain versions of imlib. And other various code cleanups. Also initial code for eventual conversion to gdk-pixbuf on unix from imlib.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 02 Nov 2001 10:31:29 +0000
parents 88c9c7410c22
children bf42d08d72d7
comparison
equal deleted inserted replaced
46:30d091bc7899 47:997e9ed670ef
594 */ 594 */
595 int _resize_box(Box *thisbox, int *depth, int x, int y, int *usedx, int *usedy, 595 int _resize_box(Box *thisbox, int *depth, int x, int y, int *usedx, int *usedy,
596 int pass, int *usedpadx, int *usedpady) 596 int pass, int *usedpadx, int *usedpady)
597 { 597 {
598 int z, currentx = 0, currenty = 0; 598 int z, currentx = 0, currenty = 0;
599 int vectorx = 0, vectory = 0;
600 int uymax = 0, uxmax = 0; 599 int uymax = 0, uxmax = 0;
601 int upymax = 0, upxmax = 0; 600 int upymax = 0, upxmax = 0;
602 /* Used for the SIZEEXPAND */ 601 /* Used for the SIZEEXPAND */
603 int nux = *usedx, nuy = *usedy; 602 int nux = *usedx, nuy = *usedy;
604 int nupx = *usedpadx, nupy = *usedpady; 603 int nupx = *usedpadx, nupy = *usedpady;
859 } 858 }
860 } 859 }
861 860
862 (*depth)++; 861 (*depth)++;
863 862
864 /*tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmp->upx) )/((float)(tmp->minwidth-tmp->upx));
865 tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmp->upy))/((float)(tmp->minheight-tmp->upy));*/
866
867 #ifdef DWDEBUG 863 #ifdef DWDEBUG
868 fprintf(f, "2- Resize Box depth %d\r\nx = %d, y = %d, usedx = %d, usedy = %d, usedpadx = %d, usedpady = %d xratio = %f, yratio = %f,\r\nupx = %d, upy = %d, width = %d, height = %d, minwidth = %d, minheight = %d, box xratio = %f, box yratio = %f\r\n\r\n", 864 fprintf(f, "2- Resize Box depth %d\r\nx = %d, y = %d, usedx = %d, usedy = %d, usedpadx = %d, usedpady = %d xratio = %f, yratio = %f,\r\nupx = %d, upy = %d, width = %d, height = %d, minwidth = %d, minheight = %d, box xratio = %f, box yratio = %f\r\n\r\n",
869 *depth, x, y, *usedx, *usedy, *usedpadx, *usedpady, tmp->xratio, tmp->yratio, tmp->upx, tmp->upy, thisbox->items[z].width, thisbox->items[z].height, tmp->minwidth, tmp->minheight, thisbox->xratio, thisbox->yratio); 865 *depth, x, y, *usedx, *usedy, *usedpadx, *usedpady, tmp->xratio, tmp->yratio, tmp->upx, tmp->upy, thisbox->items[z].width, thisbox->items[z].height, tmp->minwidth, tmp->minheight, thisbox->xratio, thisbox->yratio);
870 reopen(); 866 reopen();
871 #endif 867 #endif
882 { 878 {
883 int height = thisbox->items[z].height; 879 int height = thisbox->items[z].height;
884 int width = thisbox->items[z].width; 880 int width = thisbox->items[z].width;
885 int pad = thisbox->items[z].pad; 881 int pad = thisbox->items[z].pad;
886 HWND handle = thisbox->items[z].hwnd; 882 HWND handle = thisbox->items[z].hwnd;
883 int vectorx, vectory;
887 884
888 /* When upxmax != pad*2 then ratios are incorrect. */ 885 /* When upxmax != pad*2 then ratios are incorrect. */
889 vectorx = (int)((width*thisbox->items[z].xratio)-width); 886 vectorx = (int)((width*thisbox->items[z].xratio)-width);
890 vectory = (int)((height*thisbox->items[z].yratio)-height); 887 vectory = (int)((height*thisbox->items[z].yratio)-height);
891 888
927 { 924 {
928 Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER); 925 Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER);
929 926
930 if(boxinfo && boxinfo->grouphwnd) 927 if(boxinfo && boxinfo->grouphwnd)
931 WinSetWindowPos(boxinfo->grouphwnd, HWND_TOP, 0, 0, 928 WinSetWindowPos(boxinfo->grouphwnd, HWND_TOP, 0, 0,
932 width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE /*| SWP_ZORDER*/); 929 width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE);
933 930
934 } 931 }
935 932
936 } 933 }
937 934
2917 newbox->grouphwnd = NULLHANDLE; 2914 newbox->grouphwnd = NULLHANDLE;
2918 2915
2919 hwndframe = WinCreateWindow(HWND_OBJECT, 2916 hwndframe = WinCreateWindow(HWND_OBJECT,
2920 WC_FRAME, 2917 WC_FRAME,
2921 NULL, 2918 NULL,
2922 WS_VISIBLE | WS_CLIPCHILDREN, 2919 WS_VISIBLE | WS_CLIPCHILDREN |
2920 FS_NOBYTEALIGN,
2923 0,0,2000,1000, 2921 0,0,2000,1000,
2924 NULLHANDLE, 2922 NULLHANDLE,
2925 HWND_TOP, 2923 HWND_TOP,
2926 0L, 2924 0L,
2927 NULL, 2925 NULL,
2950 newbox->count = 0; 2948 newbox->count = 0;
2951 2949
2952 hwndframe = WinCreateWindow(HWND_OBJECT, 2950 hwndframe = WinCreateWindow(HWND_OBJECT,
2953 WC_FRAME, 2951 WC_FRAME,
2954 NULL, 2952 NULL,
2955 WS_VISIBLE, 2953 WS_VISIBLE |
2954 FS_NOBYTEALIGN,
2956 0,0,2000,1000, 2955 0,0,2000,1000,
2957 NULLHANDLE, 2956 NULLHANDLE,
2958 HWND_TOP, 2957 HWND_TOP,
2959 0L, 2958 0L,
2960 NULL, 2959 NULL,
2989 HWND hwndframe; 2988 HWND hwndframe;
2990 2989
2991 hwndframe = WinCreateWindow(HWND_OBJECT, 2990 hwndframe = WinCreateWindow(HWND_OBJECT,
2992 WC_FRAME, 2991 WC_FRAME,
2993 NULL, 2992 NULL,
2994 WS_VISIBLE | WS_CLIPCHILDREN, 2993 WS_VISIBLE | WS_CLIPCHILDREN |
2994 FS_NOBYTEALIGN,
2995 0,0,2000,1000, 2995 0,0,2000,1000,
2996 NULLHANDLE, 2996 NULLHANDLE,
2997 HWND_TOP, 2997 HWND_TOP,
2998 0L, 2998 0L,
2999 NULL, 2999 NULL,
5193 HWND dw_render_new(unsigned long id) 5193 HWND dw_render_new(unsigned long id)
5194 { 5194 {
5195 HWND hwndframe = WinCreateWindow(HWND_OBJECT, 5195 HWND hwndframe = WinCreateWindow(HWND_OBJECT,
5196 WC_FRAME, 5196 WC_FRAME,
5197 NULL, 5197 NULL,
5198 WS_VISIBLE, 5198 WS_VISIBLE |
5199 FS_NOBYTEALIGN,
5199 0,0,2000,1000, 5200 0,0,2000,1000,
5200 NULLHANDLE, 5201 NULLHANDLE,
5201 HWND_TOP, 5202 HWND_TOP,
5202 id, 5203 id,
5203 NULL, 5204 NULL,