1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00
wine/objects/oembitmap.c
Alexandre Julliard 3ed37e0869 Release 941107
Sun Nov  6 18:52:04 1994  Alexandre Julliard  (julliard@lamisun.epfl.ch)

	* [objects/oembitmap.c]  (New file)
	Added possibility to use .xpm files for OEM bitmaps.

	* [include/bitmaps/obm*]  (New files)
	Redrawn all OEM bitmaps in xpm format.

	* [objects/font.c]
	Add space for internal leading when using a negative font height.
	Stubs for AddFontResource() and RemoveFontResource().
	Fix in FONT_Init() for uninitialised default font.

	* [windows/dialog.c]
	Make font height negative as it is really a point size and not a
	pixel size; dialogs using 8-point fonts look better now.

	* [windows/graphics.c]
	Fixed the fix :-) for Pie() to make it work for Arc() and Chord() also.

	* [windows/nonclient.c]
	A few changes for new OEM bitmaps.

Sun Nov  6 18:22:18 1994  Michael Patra  <micky@marie.physik.tu-berlin.de>

	* [windows/class.c]
	The names of local classes have to be stored using GlobalAtom*.
	Otherwise they couldn't be accessed from other modules (e.g. BWCC) 

	* [if1632/call.S]
	CallTo16(cx): It's possible to set the contents of the cx-register.

	* [loader/ne_image.c]
	InitNEDLL(): The size of the local heap is now passed in the cx-
	register when initializing a DLL.

	* [memory/heap.c]
	LocalInit(): The case start==0 is now handled in the way it should.

	* [windows/win.c]
	GetWindowLong(): If the adress of the windows function is requested
	it's no longer returned if it's within the Wine code (and therefore
	unreachable by a windows program). This makes Borland's OWL happy.

	* [controls/edit.c]
	EDIT_GetStr(): Added handling for off<0.

Sun Nov  6 17:37:14 1994  Chris Jones  <chrisj@ichips.intel.com>

	* [loader/library.c]
	Fixed infinite loop bug when two DLLs refer to each other (fixes
	hangup of Quicken during loading).

Thu Nov 04 12:00:00 1994  Jan Willamowius  (jan@janhh.sh.sub.de)

	* [misc/dos_fs.c]
	Bug fix: The size of a disk an the available space
	is now returned in bytes instead of (incorrectly)
	KBytes.

Thu Nov 03 12:00:00 1994  Jan Willamowius  (jan@janhh.sh.sub.de)

	* [windows/graphics.c]
	Bug fix: Pie segments are now filled with correct brush.

Thu Nov  3 10:40:09 1994  Martin von Loewis  (martin@cs.csufresno.edu)

        * [Imakefile]
        generate rc.o before loader.o

        * [controls/menu.c]
        CopySysMenu: generate SYSMENU on the fly, eliminate hSysMenu

        * [include/resource.h]
        Add struct ResourceTable

        * [loader/bitmap.h]
        Load system bitmaps from sysresbmTable

        * [misc/clipboard.c]
          [windows/event.c]
        IsClipboardFormatAvailable,EVENT_SelectionRequest: bug fixes
        
        * [rc/Imakefile]
        generate rc.o from sysres.o and sysresbm.o. Added -lfl

        * [rc/rc.y]
        change style handling to allow ( S1 | S2 ) | S3

        * [rc/sysres.rc]
          [rc/sysresbm.rc]
        Put bitmaps and icons to sysresbm, everything else to sysres

        * [rc/winerc.c]
          [rc/winerc.h]
        Added -o, -c flags. New function set_out_file. Output to files.

        * [windows/dialog.c]
        DialogBoxIndirectPtr, DialogBoxIndirectParamPtr: New functions 

        * [windows/nonclient.c]
        Create AboutWine dialog from template pointer
1994-11-07 18:20:42 +00:00

238 lines
7.4 KiB
C

/*
* GDI OEM bitmap objects
*
* Copyright 1994 Alexandre Julliard
*/
static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef USE_XPM
#include <X11/xpm.h>
#endif
#include "gdi.h"
#include "bitmap.h"
#include "stddebug.h"
/* #define DEBUG_BITMAP */
#include "debug.h"
#define OBM_FIRST OBM_LFARROWI /* First OEM bitmap */
#define OBM_LAST OBM_OLD_CLOSE /* Last OEM bitmap */
#ifdef USE_XPM
/* Known symbolic names for colors. Use these whenever possible. */
struct sys_colors_symbols
{
char *symbol;
WORD syscolor;
};
static const struct sys_colors_symbols OBM_Color_Symbols[] =
{
{ "button_face", COLOR_BTNFACE },
{ "button_shadow", COLOR_BTNSHADOW },
{ "button_highlight", COLOR_BTNHIGHLIGHT }
};
/* Include OEM pixmaps */
#include "bitmaps/obm_lfarrowi"
#include "bitmaps/obm_rgarrowi"
#include "bitmaps/obm_dnarrowi"
#include "bitmaps/obm_uparrowi"
#include "bitmaps/obm_combo"
#include "bitmaps/obm_mnarrow"
#include "bitmaps/obm_lfarrowd"
#include "bitmaps/obm_rgarrowd"
#include "bitmaps/obm_dnarrowd"
#include "bitmaps/obm_uparrowd"
#include "bitmaps/obm_restored"
#include "bitmaps/obm_zoomd"
#include "bitmaps/obm_reduced"
#include "bitmaps/obm_restore"
#include "bitmaps/obm_zoom"
#include "bitmaps/obm_reduce"
#include "bitmaps/obm_lfarrow"
#include "bitmaps/obm_rgarrow"
#include "bitmaps/obm_dnarrow"
#include "bitmaps/obm_uparrow"
#include "bitmaps/obm_close"
#include "bitmaps/obm_old_restore"
#include "bitmaps/obm_old_zoom"
#include "bitmaps/obm_old_reduce"
#include "bitmaps/obm_btncorners"
#include "bitmaps/obm_checkboxes"
#include "bitmaps/obm_check"
#include "bitmaps/obm_btsize"
#include "bitmaps/obm_old_lfarrow"
#include "bitmaps/obm_old_rgarrow"
#include "bitmaps/obm_old_dnarrow"
#include "bitmaps/obm_old_uparrow"
#include "bitmaps/obm_size"
#include "bitmaps/obm_old_close"
static const struct
{
char** data; /* Pointer to bitmap data */
BOOL color; /* Is it a color bitmap? */
} OBM_Pixmaps_Data[OBM_LAST-OBM_FIRST+1] = {
{ obm_lfarrowi, TRUE }, /* OBM_LFARROWI */
{ obm_rgarrowi, TRUE }, /* OBM_RGARROWI */
{ obm_dnarrowi, TRUE }, /* OBM_DNARROWI */
{ obm_uparrowi, TRUE }, /* OBM_UPARROWI */
{ obm_combo, FALSE }, /* OBM_COMBO */
{ obm_mnarrow, FALSE }, /* OBM_MNARROW */
{ obm_lfarrowd, TRUE }, /* OBM_LFARROWD */
{ obm_rgarrowd, TRUE }, /* OBM_RGARROWD */
{ obm_dnarrowd, TRUE }, /* OBM_DNARROWD */
{ obm_uparrowd, TRUE }, /* OBM_UPARROWD */
{ obm_restored, TRUE }, /* OBM_RESTORED */
{ obm_zoomd, TRUE }, /* OBM_ZOOMD */
{ obm_reduced, TRUE }, /* OBM_REDUCED */
{ obm_restore, TRUE }, /* OBM_RESTORE */
{ obm_zoom, TRUE }, /* OBM_ZOOM */
{ obm_reduce, TRUE }, /* OBM_REDUCE */
{ obm_lfarrow, TRUE }, /* OBM_LFARROW */
{ obm_rgarrow, TRUE }, /* OBM_RGARROW */
{ obm_dnarrow, TRUE }, /* OBM_DNARROW */
{ obm_uparrow, TRUE }, /* OBM_UPARROW */
{ obm_close, TRUE }, /* OBM_CLOSE */
{ obm_old_restore, FALSE }, /* OBM_OLD_RESTORE */
{ obm_old_zoom, FALSE }, /* OBM_OLD_ZOOM */
{ obm_old_reduce, FALSE }, /* OBM_OLD_REDUCE */
{ obm_btncorners, FALSE }, /* OBM_BTNCORNERS */
{ obm_checkboxes, FALSE }, /* OBM_CHECKBOXES */
{ obm_check, FALSE }, /* OBM_CHECK */
{ obm_btsize, FALSE }, /* OBM_BTSIZE */
{ obm_old_lfarrow, FALSE }, /* OBM_OLD_LFARROW */
{ obm_old_rgarrow, FALSE }, /* OBM_OLD_RGARROW */
{ obm_old_dnarrow, FALSE }, /* OBM_OLD_DNARROW */
{ obm_old_uparrow, FALSE }, /* OBM_OLD_UPARROW */
{ obm_size, FALSE }, /* OBM_SIZE */
{ obm_old_close, FALSE }, /* OBM_OLD_CLOSE */
};
#else /* USE_XPM */
/* Include OEM bitmaps */
#include "bitmaps/check_boxes"
#include "bitmaps/check_mark"
#include "bitmaps/menu_arrow"
static const struct
{
WORD width, height;
char *data;
} OBM_Bitmaps_Data[OBM_LAST-OBM_FIRST+1] =
{
{ 0, 0, NULL }, /* OBM_LFARROWI */
{ 0, 0, NULL }, /* OBM_RGARROWI */
{ 0, 0, NULL }, /* OBM_DNARROWI */
{ 0, 0, NULL }, /* OBM_UPARROWI */
{ 0, 0, NULL }, /* OBM_COMBO */
{ menu_arrow_width, menu_arrow_height, menu_arrow_bits }, /* OBM_MNARROW */
{ 0, 0, NULL }, /* OBM_LFARROWD */
{ 0, 0, NULL }, /* OBM_RGARROWD */
{ 0, 0, NULL }, /* OBM_DNARROWD */
{ 0, 0, NULL }, /* OBM_UPARROWD */
{ 0, 0, NULL }, /* OBM_RESTORED */
{ 0, 0, NULL }, /* OBM_ZOOMD */
{ 0, 0, NULL }, /* OBM_REDUCED */
{ 0, 0, NULL }, /* OBM_RESTORE */
{ 0, 0, NULL }, /* OBM_ZOOM */
{ 0, 0, NULL }, /* OBM_REDUCE */
{ 0, 0, NULL }, /* OBM_LFARROW */
{ 0, 0, NULL }, /* OBM_RGARROW */
{ 0, 0, NULL }, /* OBM_DNARROW */
{ 0, 0, NULL }, /* OBM_UPARROW */
{ 0, 0, NULL }, /* OBM_CLOSE */
{ 0, 0, NULL }, /* OBM_OLD_RESTORE */
{ 0, 0, NULL }, /* OBM_OLD_ZOOM */
{ 0, 0, NULL }, /* OBM_OLD_REDUCE */
{ 0, 0, NULL }, /* OBM_BTNCORNERS */
{ check_boxes_width, check_boxes_height,
check_boxes_bits }, /* OBM_CHECKBOXES */
{ check_mark_width, check_mark_height, check_mark_bits }, /* OBM_CHECK */
{ 0, 0, NULL }, /* OBM_BTSIZE */
{ 0, 0, NULL }, /* OBM_OLD_LFARROW */
{ 0, 0, NULL }, /* OBM_OLD_RGARROW */
{ 0, 0, NULL }, /* OBM_OLD_DNARROW */
{ 0, 0, NULL }, /* OBM_OLD_UPARROW */
{ 0, 0, NULL }, /* OBM_SIZE */
{ 0, 0, NULL }, /* OBM_OLD_CLOSE */
};
#endif /* USE_XPM */
extern Colormap COLOR_WinColormap;
/***********************************************************************
* OBM_LoadOEMBitmap
*/
HBITMAP OBM_LoadOEMBitmap( WORD id )
{
BITMAPOBJ * bmpObjPtr;
HBITMAP hbitmap;
WORD width, height, bpp;
Pixmap pixmap;
if ((id < OBM_FIRST) || (id > OBM_LAST)) return 0;
id -= OBM_FIRST;
#ifdef USE_XPM
if (!OBM_Pixmaps_Data[id].data) return 0;
{
XpmAttributes attrs;
attrs.valuemask = XpmColormap | XpmDepth;
attrs.colormap = COLOR_WinColormap;
if (OBM_Pixmaps_Data[id].color) attrs.depth = bpp = screenDepth;
else attrs.depth = bpp = 1;
if (XpmCreatePixmapFromData( display, rootWindow,
OBM_Pixmaps_Data[id].data,
&pixmap, NULL, &attrs ) != XpmSuccess)
{
fprintf( stderr, "Error creating pixmap\n" );
pixmap = 0;
}
else
{
width = attrs.width;
height = attrs.height;
}
}
#else
if (!OBM_Bitmaps_Data[id].data) return 0;
bpp = 1;
width = OBM_Bitmaps_Data[id].width;
height = OBM_Bitmaps_Data[id].height;
pixmap = XCreateBitmapFromData( display, rootWindow,
OBM_Bitmaps_Data[id].data, width, height );
#endif /* USE_XPM */
if (!pixmap) return 0;
/* Create the BITMAPOBJ */
if (!(hbitmap = GDI_AllocObject( sizeof(BITMAPOBJ), BITMAP_MAGIC )))
{
XFreePixmap( display, pixmap );
return 0;
}
bmpObjPtr = (BITMAPOBJ *) GDI_HEAP_ADDR( hbitmap );
bmpObjPtr->size.cx = 0;
bmpObjPtr->size.cy = 0;
bmpObjPtr->pixmap = pixmap;
bmpObjPtr->bitmap.bmType = 0;
bmpObjPtr->bitmap.bmWidth = width;
bmpObjPtr->bitmap.bmHeight = height;
bmpObjPtr->bitmap.bmWidthBytes = (width + 15) / 16 * 2;
bmpObjPtr->bitmap.bmPlanes = 1;
bmpObjPtr->bitmap.bmBitsPixel = bpp;
bmpObjPtr->bitmap.bmBits = NULL;
return hbitmap;
}