1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

kde 1.1 update

This commit is contained in:
kojima
1999-03-20 02:41:23 +00:00
parent 69340d517a
commit e7532d1892
12 changed files with 188 additions and 36 deletions

View File

@@ -225,6 +225,8 @@ typedef struct WPreferences {
char *icon_path; /* : separated list of */
/* paths to find icons */
RImage *button_images; /* titlebar button images */
char size_display; /* display type for resize geometry */
char move_display; /* display type for move geometry */
char window_placement; /* window placement mode */

View File

@@ -714,13 +714,10 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
wwin->normal_hints->min_width = wwin->normal_hints->max_width;
}
if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
#ifdef DEBUG
printf("PRE ICCCM\n");
#endif
#ifdef IGNORE_PPOSITION
wwin->normal_hints->flags &= ~PPosition;
#endif
if (pre_icccm && !wwin->screen_ptr->flags.startup && geometry) {
if (wwin->normal_hints->flags & (USPosition|PPosition)) {
*x = wwin->normal_hints->x;
*y = wwin->normal_hints->y;

View File

@@ -130,7 +130,9 @@ static int getFont();
static int getColor();
static int getKeybind();
static int getModMask();
#ifdef NEWSTUFF
static int getRImage();
#endif
/* value setting functions */
static int setJustify();
@@ -168,6 +170,10 @@ static int setIconPosition();
static int setClipTitleFont();
static int setClipTitleColor();
#ifdef NEWSTUFF
static int setButtonImages();
#endif
static int updateUsableArea();
@@ -448,9 +454,15 @@ WDefaultEntry optionList[] = {
},
#endif /* WEENDOZE_CYCLE */
/* style options */
#ifdef NEWSTUFF
{"WindowButtonImages", DEF_BUTTON_IMAGES, NULL,
&wPreferences.button_images, getRImage, setButtonImages
},
#else
{"WidgetColor", "(solid, gray)", NULL,
NULL, getTexture, setWidgetColor,
},
#endif
{"WorkspaceSpecificBack","()", NULL,
NULL, getWSSpecificBackground, setWorkspaceSpecificBack
},
@@ -535,7 +547,6 @@ WDefaultEntry optionList[] = {
{"IconTitleBack", "black", NULL,
NULL, getColor, setIconTitleBack
},
/* keybindings */
#ifndef LITE
{"RootMenuKey", "None", (void*)WKBD_ROOTMENU,
@@ -1036,6 +1047,8 @@ wDefaultsCheckDomains(void *foo)
#define REFRESH_ICON_FONT (1<<7)
#define REFRESH_WORKSPACE_BACK (1<<8)
#define REFRESH_BUTTON_IMAGES (1<<9)
static void
refreshMenus(WScreen *scr, int flags)
{
@@ -1202,6 +1215,37 @@ wReadDefaults(WScreen *scr, proplist_t new_dict)
if (needs_refresh & REFRESH_ICON_TILE)
refreshAppIcons(scr, needs_refresh);
#ifdef NEWSTUFF
if ((needs_refresh & REFRESH_BUTTON_IMAGES)
&& wPreferences.button_images) {
int w, h;
RImage *image = wPreferences.button_images;
RImage *tmp;
int theight;
w = wPreferences.button_images->width / 2;
h = wPreferences.button_images->height / PRED_BPIXMAPS;
theight = scr->title_font->height + TITLEBAR_EXTRA_HEIGHT - 3;
for (i = 0; i < PRED_BPIXMAPS; i++) {
tmp = RGetSubImage(image, 0, i * h, w, h);
if (scr->button_images[0][i])
RDestroyImage(scr->button_images[0][i]);
scr->button_images[0][i] = RScaleImage(tmp, theight, theight);
RDestroyImage(tmp);
tmp = RGetSubImage(image, w, i * h, image->width - w, h);
if (scr->button_images[1][i])
RDestroyImage(scr->button_images[1][i]);
scr->button_images[1][i] = RScaleImage(tmp, theight, theight);
RDestroyImage(tmp);
}
}
#endif /* NEWSTUFF */
wRefreshDesktop(scr);
}
}
@@ -2114,9 +2158,8 @@ getFont(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
if (ret)
*ret = font;
if (addr) {
wwarning("BUG:can't assign font value outside update function");
}
/* can't assign font value outside update function */
wassertrv(addr == NULL, True);
return True;
}
@@ -2256,6 +2299,46 @@ getModMask(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
}
#ifdef NEWSTUFF
static int
getRImages(WScreen *scr, WDefaultEntry *entry, proplist_t value,
void *addr, void **ret)
{
unsigned int mask;
char *str;
RImage *image;
int i, n;
int w, h;
STRINGP("Image File Path");
str = PLGetString(value);
if (!str)
return False;
image = RLoadImage(scr->rcontext, str, 0);
if (!image) {
wwarning(_("could not load image in option %s: %s"), entry->key,
RMessageForError(RErrorCode));
return False;
}
if (*(RImage**)addr) {
RDestroyImage(*(RImage**)addr);
}
if (addr)
*(RImage**)addr = image;
assert(ret == NULL);
/*
if (ret)
*(RImage**)ret = image;
*/
return True;
}
#endif
/* ---------------- value setting functions --------------- */
static int
@@ -2383,7 +2466,7 @@ setWinTitleFont(WScreen *scr, WDefaultEntry *entry, WFont *font, void *foo)
XSetFont(dpy, scr->window_title_gc, font->font->fid);
#endif
return REFRESH_WINDOW_FONT;
return REFRESH_WINDOW_FONT|REFRESH_BUTTON_IMAGES;
}
@@ -2916,6 +2999,13 @@ updateUsableArea(WScreen *scr, WDefaultEntry *entry, void *bar, void *foo)
static int
setButtonImages(WScreen *scr, WDefaultEntry *entry, int *value, void *foo)
{
return REFRESH_BUTTON_IMAGES;
}
/*
* Very ugly kluge.
* Need access to the double click variables, so that all widgets in
@@ -2937,5 +3027,3 @@ setDoubleClick(WScreen *scr, WDefaultEntry *entry, int *value, void *foo)
return 0;
}

View File

@@ -214,7 +214,10 @@ enum {
KWMnoDecoration = 0,
KWMnormalDecoration = 1,
KWMtinyDecoration = 2,
KWMnoFocus = 256
KWMnoFocus = 256,
KWMstandaloneMenuBar = 512,
KWMdesktopIcon = 1024,
KWMstaysOnTop = 2048
};
@@ -716,7 +719,7 @@ wKWMShutdown(WScreen *scr, Bool closeModules)
void
wKWMCheckClientHints(WWindow *wwin, int *workspace)
wKWMCheckClientHints(WWindow *wwin, int *layer, int *workspace)
{
long val;
@@ -737,6 +740,21 @@ wKWMCheckClientHints(WWindow *wwin, int *workspace)
case KWMtinyDecoration:
wwin->client_flags.no_resizebar = 1;
break;
case KWMstandaloneMenuBar:
wwin->client_flags.no_titlebar = 1;
wwin->client_flags.no_resizebar = 1;
wwin->client_flags.no_resizable = 1;
wwin->client_flags.skip_window_list = 1;
wwin->client_flags.no_hide_others = 1;
wwin->flags.kwm_menubar = 1;
*layer = WMMainMenuLevel;
break;
case KWMdesktopIcon:
*layer = WMDesktopLevel;
break;
case KWMstaysOnTop:
*layer = WMFloatingLevel;
break;
case KWMnormalDecoration:
default:
break;
@@ -757,13 +775,11 @@ wKWMCheckClientInitialState(WWindow *wwin)
wwin->client_flags.omnipresent = 1;
}
if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_ICONIFIED, &val)
&& val) {
if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_ICONIFIED, &val) && val) {
wwin->flags.miniaturized = 1;
}
if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_MAXIMIZED, &val)
&& val) {
if (getSimpleHint(wwin->client_win, _XA_KWM_WIN_MAXIMIZED, &val) && val) {
wwin->flags.maximized = MAX_VERTICAL|MAX_HORIZONTAL;
}
@@ -1393,12 +1409,26 @@ void
wKWMUpdateActiveWindowHint(WScreen *scr)
{
long val;
WWindow *wwin, *tmp;
if (!scr->focused_window || !scr->focused_window->flags.focused)
val = None;
else
else {
val = (long)(scr->focused_window->client_win);
/* raise the menubar thing */
wwin = scr->focused_window;
tmp = wwin->prev;
while (tmp) {
if (tmp->flags.kwm_menubar
&& tmp->transient_for == wwin->client_win) {
wRaiseFrame(tmp->frame->core);
break;
}
tmp = tmp->prev;
}
}
XChangeProperty(dpy, scr->root_win, _XA_KWM_ACTIVE_WINDOW,
_XA_KWM_ACTIVE_WINDOW, 32, PropModeReplace,
(unsigned char*)&val, 1);

View File

@@ -45,7 +45,7 @@ void wKWMInitStuff(WScreen *scr);
Bool wKWMGetUsableArea(WScreen *scr, WArea *area);
void wKWMCheckClientHints(WWindow *wwin, int *workspace);
void wKWMCheckClientHints(WWindow *wwin, int *layer, int *workspace);
Bool wKWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event);

View File

@@ -140,7 +140,10 @@ wMenuCreate(WScreen *screen, char *title, int main_menu)
menu->frame->flags.justification = WTJ_LEFT;
#ifndef NEWSTUFF
/* XXX */
menu->frame->rbutton_image = screen->b_pixmaps[WBUT_CLOSE];
#endif
menu->entry_no = 0;
menu->alloced_entries = 0;

View File

@@ -155,6 +155,7 @@ alreadyRunningError(Display *dpy, XErrorEvent *error)
* not be freed by anybody.
*----------------------------------------------------------------------
*/
#ifndef NEWSTUFF
static void
allocButtonPixmaps(WScreen *scr)
{
@@ -181,6 +182,7 @@ allocButtonPixmaps(WScreen *scr)
pix->shared = 1;
scr->b_pixmaps[WBUT_KILL] = pix;
}
#endif
@@ -447,8 +449,10 @@ createPixmaps(WScreen *scr)
scr->dock_dots = make3Dots(scr);
}
#ifndef NEWSTUFF
/* titlebar button pixmaps */
allocButtonPixmaps(scr);
#endif
}

View File

@@ -200,7 +200,9 @@ typedef struct _WScreen {
GC icon_select_gc;
GC draw_gc; /* gc for drawing misc things */
#ifndef NEWSTUFF
struct WPixmap *b_pixmaps[PRED_BPIXMAPS]; /* internal pixmaps for buttons*/
#endif
struct WPixmap *menu_radio_indicator;/* left menu indicator */
struct WPixmap *menu_check_indicator;/* left menu indicator for checkmark */
struct WPixmap *menu_mini_indicator; /* for miniwindow */
@@ -248,6 +250,10 @@ typedef struct _WScreen {
struct WDialogData *dialog_data;
#ifdef NEWSTUFF
struct RImage *button_images[2][PRED_BPIXMAPS];/* scaled tbar btn images */
#endif
/* state and other informations */
short cascade_index; /* for cascade window placement */

View File

@@ -94,6 +94,8 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
return;
}
XSetClipMask(dpy, scr->copy_gc, None);
for (i=0; i<DEMATERIALIZE_STEPS; i++) {
XEvent foo;
if (XCheckTypedEvent(dpy, ButtonPress, &foo)) {

View File

@@ -635,7 +635,9 @@ bevelImage(RImage *image, int relief)
case WREL_MENUENTRY:
color.red = color.green = color.blue = 80;
color.alpha = 0;
/*
ROperateLine(image, RAddOperation, 1, 0, width-2, 0, &color);
*/
ROperateLine(image, RAddOperation, 0, 0, 0, height-1, &color);
@@ -644,12 +646,14 @@ bevelImage(RImage *image, int relief)
ROperateLine(image, RSubtractOperation, width-1, 0, width-1,
height-1, &color);
/*
ROperateLine(image, RSubtractOperation, 1, height-2, width-2,
height-2, &color);
color.red = color.green = color.blue = 0;
color.alpha = 255;
RDrawLine(image, 0, height-1, width-1, height-1, &color);
*/
break;
}

View File

@@ -37,6 +37,14 @@
*--------------------------------------------------------------------
*/
/*
* #undefine if you dont want texture plugin support or your system have
* some sort of problem with them.
*/
#define TEXTURE_PLUGIN
/* undefine WEENDOZE_CYCLING to remove all Windoze style Alt-Tab cycling
* If define, windoze cycling must still be enabled with the
* WindozeCycling = YES and FinishedCyclingKey = Meta_L options
@@ -158,7 +166,7 @@
* define HIDDENDOT if you want a dot to be shown in the application icon
* of applications that are hidden.
*/
#undef HIDDENDOT
#define HIDDENDOT
/*
@@ -166,11 +174,12 @@
* programs that have buggy implementations of such hint and place
* themselves in strange locations.
*/
#undef IGNORE_NOPPOSITION
#undef IGNORE_PPOSITION
#define SILLYNESS
/*
*..........................................................................
* The following options WILL NOT BE MADE RUN-TIME. Please do not request.
@@ -237,6 +246,12 @@
#define DEFAULTS_DIR "Defaults"
#ifdef USE_TIFF
#define DEF_BUTTON_IMAGES PKGDATADIR"/buttons.tiff"
#else
#define DEF_BUTTON_IMAGES PKGDATADIR"/buttons.xpm"
#endif
/* the file of the system wide submenu to be forced into the main menu */
/* remove the comments if you want it */
/*

View File

@@ -271,6 +271,7 @@ typedef struct WWindow {
#ifdef KWM_HINTS
unsigned int kwm_hidden_for_modules:1;
unsigned int kwm_managed:1;
unsigned int kwm_menubar:1;
#endif
#ifdef OLWM_HINTS
unsigned int olwm_push_pin_out:1;/* emulate pushpin behaviour */