Initial commit
This commit is contained in:
14
libXmd/XmdIcon.c
Normal file
14
libXmd/XmdIcon.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <Xmd/Icon.h>
|
||||
|
||||
Pixmap _XmdLoadBitmapIcon (Widget widget, unsigned char *bits, int width, int height) {
|
||||
Pixel fg, bg;
|
||||
XtVaGetValues (widget,
|
||||
XmNforeground, &fg,
|
||||
XmNbackground, &bg,
|
||||
NULL);
|
||||
return XCreatePixmapFromBitmapData (
|
||||
XtDisplay (widget),
|
||||
RootWindowOfScreen(XtScreen(widget)),
|
||||
(char *)(bits), width, height,
|
||||
fg, bg, DefaultDepthOfScreen(XtScreen(widget)));
|
||||
}
|
||||
26
libXmd/build.sh
Executable file
26
libXmd/build.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ../scripts/flags.sh
|
||||
|
||||
function build() {
|
||||
cc $CFLAGS -shared -o "lib/libXmd.so" *.c || \
|
||||
echo "XXX FAIL!"
|
||||
}
|
||||
|
||||
function clean() {
|
||||
rm -f lib/*
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
clean; build
|
||||
cp lib/*.so "$PREFIX/lib"
|
||||
cp include/Xmd/*.h "$PREFIX/include/Xmd"
|
||||
clean
|
||||
;;
|
||||
clean)
|
||||
clean
|
||||
;;
|
||||
*)
|
||||
build
|
||||
esac
|
||||
13
libXmd/include/Xmd/Icon.h
Normal file
13
libXmd/include/Xmd/Icon.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _XmdIcon_h
|
||||
#define _XmdIcon_h
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/* XmdLoadBitmapIcon is a macro that loads an icon with the specified name. That Icon must
|
||||
be #include'd in your code somewhere. The name parameter must be a token, not a string. */
|
||||
#define XmdLoadBitmapIcon(widget, name) _XmdLoadBitmapIcon(widget, name##_bits, name##_width, name##_height)
|
||||
Pixmap _XmdLoadBitmapIcon (Widget widget, unsigned char *bits, int width, int height);
|
||||
|
||||
#endif
|
||||
13
libXmd/include/Xmd/Launcher.h
Normal file
13
libXmd/include/Xmd/Launcher.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _XmdLauncher_h
|
||||
#define _XmdLauncher_h
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
typedef struct {
|
||||
Pixmap icon;
|
||||
const char *command;
|
||||
} XmdLauncher;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user