/*----------------------------------------------------------------------*/ static void Redisplay(Widget w,XEvent *event,Region region) { XmCascadeButtonWidgetClass pwc = (XmCascadeButtonWidgetClass) xmCascadeButtonWidgetClass; if (XfeBmAccentIsEnabled()) { Dimension shadow_thickness = _XfeShadowThickness(w); /* * We change the shadow thickness to 0, so that the real Expose() * method not draw anything the shadow so that the accent lines * are not disturbed. */ _XfeShadowThickness(w) = 0; _XfeHighlightThickness(w) = shadow_thickness; (*pwc->core_class.expose)(w,event,region); _XfeShadowThickness(w) = shadow_thickness; _XfeHighlightThickness(w) = 0; } else { (*pwc->core_class.expose)(w,event,region); } DrawPixmap(w,event,region); }
/*----------------------------------------------------------------------*/ static void CheckDisarm(Widget w,XEvent * event,char ** params,Cardinal * nparams) { static XtActionProc check_disarm_action = NULL; XfeBmCascadePart * bmc = _XfeBmCascadePart(w); if (!check_disarm_action) { check_disarm_action = _XfeGetActionProc(xmCascadeButtonWidgetClass, "CheckDisarm"); } if (XfeBmAccentIsEnabled()) { _XfeBmActionWithoutDrawing(w,check_disarm_action,event,params,nparams); AccentUpdate(w,XfeACCENT_OUTSIDE); } else { check_disarm_action(w,event,params,nparams); } /* * Redraw the pixmap since fancy motif menus such as those in * irix or cde will fill the whole background and erase the * previous menu. This should be smarter, and redraw the pixmap * only if needed, but the extra waste in time is smaller than * the effort needed to implement it. */ DrawPixmap(w,NULL,NULL); }
bool WaveExplorerUi::GetPixmap(const int &stationid, const int &cnt, QPixmap *pixmap) { if (style_changed_) { MISEIS_JUDGE(ConfigPixmap(stationid, cnt, pixmap)); } else if (resize_flag_) { DrawPixmap(pixmap, cnt, convert_data_set_list_.at(cnt)); } else { DrawPixmap(pixmap, cnt); } return true; }
ribi::QtKnokfighterBackground::QtKnokfighterBackground( const int width, const int height, QGraphicsItem *parent) : QGraphicsPixmapItem(parent), z(0) { this->setPixmap(QPixmap(width,height)); DrawPixmap(); }
bool WaveExplorerUi::ConfigPixmap(const int &stationid, const int &cnt, QPixmap *pixmap) { WaveDataSet n_wset; DataProcessCenter::GetInstance()->GetDealedStaWaveSet(stationid, wave_style_, n_wset); DrawPixmap(pixmap, cnt, n_wset); convert_data_set_list_.append(n_wset); return true; }
int OSDRegion::PutGd(int x, int y, TYPE_GrData * gd, bool sprite) { int w = gd->width; int h = gd->height; BYTE* pData = m_GDs.GetBitmapDataForGD(gd); //CRect rect(CPoint(x,y), CSize(w, h)); //rect.OffsetRect(CPoint(GetXOffs(), GetYOffs())); //DrawFilledBox(rect, COLOR_Blue, COLOR_Cyan); DrawPixmap(x, y, w, h, pData, sprite, OSD_1555); return 0; }
gboolean on_color_sample_draw_area_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) { GdkWindow* window = widget->window; GdkGC* gc = gdk_gc_new(window); GdkPixmap* pixmap; pixmap = LoadPixmap(GetTopWidget(widget), NULL, "color_sample.xpm"); DrawPixmap(window, gc, 0, 0, pixmap, NULL); FreePixmap(pixmap, NULL); gdk_gc_unref(gc); return TRUE; }
/*----------------------------------------------------------------------*/ static void BorderUnhighlight(Widget w) { XfeBmCascadePart * bmc = _XfeBmCascadePart(w); XmCascadeButtonWidgetClass cwc = (XmCascadeButtonWidgetClass) xmCascadeButtonWidgetClass; if (XfeBmAccentIsEnabled()) { _XfeBmProcWithoutDrawing(w,cwc->primitive_class.border_unhighlight); } else { (*cwc->primitive_class.border_unhighlight)(w); } DrawPixmap(w,NULL,NULL); }
/*----------------------------------------------------------------------*/ static void DelayedArm(Widget w,XEvent * event,char ** params,Cardinal * nparams) { static XtActionProc delayed_arm_action = NULL; XfeBmCascadePart * bmc = _XfeBmCascadePart(w); if (!delayed_arm_action) { delayed_arm_action = _XfeGetActionProc(xmCascadeButtonWidgetClass, "DelayedArm"); } if (XfeBmAccentIsEnabled()) { /* * There is a very nasty motif bug that causes the cascading shell * to appear much to the right of what it is supposed to be. * * The reason for this is very complicated, but fortunately the * solution is pretty simple. By moving the parent row column * to (0,0) every time before the cascading shell is posted, the * problem is fixed. */ _XfeMoveWidget(XtParent(w),0,0); _XfeBmActionWithoutDrawing(w,delayed_arm_action,event,params,nparams); AccentUpdate(w,event->xcrossing.y); } else { delayed_arm_action(w,event,params,nparams); } /* * Redraw the pixmap since fancy motif menus such as those in * irix or cde will fill the whole background and erase the * previous menu. This should be smarter, and redraw the pixmap * only if needed, but the extra waste in time is smaller than * the effort needed to implement it. */ DrawPixmap(w,NULL,NULL); }
void DrawQualityDrawingArea(GtkWidget* window, GtkWidget* area) { GdkWindow* area_window = area->window; GdkGC* gc = gdk_gc_new(window->window); GdkPixmap* pixmap; GdkBitmap* mask; int quality; const gchar* button_name[] = { "quality_high_button", "quality_standard_button", "quality_draft_button", "quality_custom_button", NULL }; const gchar* xpm_name[] = { "quality_best.xpm", "quality_best_color.xpm", "quality_normal.xpm", "quality_normal_color.xpm", "quality_draft.xpm", "quality_draft_color.xpm", "quality_custom.xpm", "quality_custom_color.xpm" }; quality = GetActiveButtonIndex(window, button_name, 0) << 1; if( !IsGrayPrint(g_main_window) ) quality++; pixmap = LoadPixmap(window, &mask, xpm_name[quality]); DrawPixmap(area_window, gc, QUALITY_PIXMAP_X, QUALITY_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); gdk_gc_unref(gc); }
void TreeDragImage_Draw( TreeDragImage dragImage, /* Drag image record. */ TreeDrawable td) /* Where to draw. */ { #ifdef DRAG_PIXMAP DrawPixmap(tree->dragImage, tdrawable); #elif 1 /* Use XOR dotted rectangles where possible. */ TreeCtrl *tree = dragImage->tree; if (!dragImage->visible) return; #ifdef DRAGIMAGE_STYLE if (dragImage->instanceStyle != NULL) { DragImage_DrawStyle(dragImage, td); return; } #endif /* DRAGIMAGE_STYLE */ /* Yes this is XOR drawing but we aren't erasing the previous * dragimage as when TreeDragImage_IsXOR() returns TRUE. */ TreeDragImage_DrawXOR(dragImage, td.drawable, 0 - tree->xOrigin, 0 - tree->yOrigin); #else /* */ TreeCtrl *tree = dragImage->tree; GC gc; DragElem *elem; #if 1 /* Stippled rectangles: BUG not clipped to contentbox. */ XGCValues gcValues; unsigned long mask; XPoint points[5]; if (!dragImage->visible) return; gcValues.stipple = Tk_GetBitmap(tree->interp, tree->tkwin, "gray50"); gcValues.fill_style = FillStippled; mask = GCStipple|GCFillStyle; gc = Tk_GetGC(tree->tkwin, mask, &gcValues); for (elem = dragImage->elem; elem != NULL; elem = elem->next) { XRectangle rect; rect.x = dragImage->x + elem->x /*- dragImage->bounds[0]*/ - tree->drawableXOrigin; rect.y = dragImage->y + elem->y /*- dragImage->bounds[1]*/ - tree->drawableYOrigin; rect.width = elem->width; rect.height = elem->height; #ifdef WIN32 /* XDrawRectangle ignores the stipple pattern. */ points[0].x = rect.x, points[0].y = rect.y; points[1].x = rect.x + rect.width - 1, points[1].y = rect.y; points[2].x = rect.x + rect.width - 1, points[2].y = rect.y + rect.height - 1; points[3].x = rect.x, points[3].y = rect.y + rect.height - 1; points[4] = points[0]; XDrawLines(tree->display, td.drawable, gc, points, 5, CoordModeOrigin); #else /* !WIN32 */ XDrawRectangle(tree->display, td.drawable, gc, rect.x, rect.y, rect.width - 1, rect.height - 1); #endif } Tk_FreeGC(tree->display, gc); #else /* Debug/test: gray rectangles */ XColor *colorPtr; TkRegion rgn; if (!dragImage->visible) return; colorPtr = Tk_GetColor(tree->interp, tree->tkwin, "gray50"); gc = Tk_GCForColor(colorPtr, Tk_WindowId(tree->tkwin)); rgn = Tree_GetRegion(tree); for (elem = dragImage->elem; elem != NULL; elem = elem->next) { XRectangle rect; rect.x = dragImage->x + elem->x /*- dragImage->bounds[0]*/ - tree->drawableXOrigin; rect.y = dragImage->y + elem->y /*- dragImage->bounds[1]*/ - tree->drawableYOrigin; rect.width = elem->width; rect.height = elem->height; TkUnionRectWithRegion(&rect, rgn, rgn); } Tree_FillRegion(tree->display, td.drawable, gc, rgn); Tree_FreeRegion(tree, rgn); #endif /* Debug/test: gray rectangles */ #endif /* XOR */ }
void DrawPrinterDrawingArea(GtkWidget* window, GtkWidget* area) { GdkWindow* area_window = area->window; GdkPixmap* pixmap; GdkBitmap* mask; gchar* xpm_name; gchar* key_str; gchar* message_str; GdkGC* gc = gdk_gc_new(window->window); // Background pattern. pixmap = LoadPixmap(window, NULL, "bg.xpm"); DrawPixmap(area_window, gc, 0, 0, pixmap, NULL); FreePixmap(pixmap, NULL); // Printer body. pixmap = LoadPixmap(window, &mask, "printer.xpm"); DrawPixmap(area_window, gc, BODY_PIXMAP_X, BODY_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); // Paper set and out. // Right guide(Paper set). { gchar* in_xpm_name; gchar* out_xpm_name; gchar* guide_xpm_name; short supply = GetCurrentnValue(CNCL_MEDIASUPPLY); #ifdef SUPPORT_BANNER short media = GetCurrentnValue(CNCL_MEDIATYPE); #endif short size = GetCurrentnValue(CNCL_PAPERSIZE); if( supply == CND_SUPPLY_MANUAL ) in_xpm_name = "in_m.xpm"; else in_xpm_name = NULL; #ifdef SUPPORT_BANNER if( media == CND_MEDIA_BANNER ) guide_xpm_name = "guide_a3.xpm"; else #endif guide_xpm_name = NULL; if( GetPaperWidth(size) > GetPaperHeight(size) ) { if( in_xpm_name == NULL ) in_xpm_name = "in_l.xpm"; if( guide_xpm_name == NULL ) guide_xpm_name = "guide_a2.xpm"; out_xpm_name = "out_ph.xpm"; } else { if( in_xpm_name == NULL ) in_xpm_name = "in_p.xpm"; if( guide_xpm_name == NULL ) guide_xpm_name = "guide_a1.xpm"; out_xpm_name = "out_pv.xpm"; } pixmap = LoadPixmap(window, &mask, in_xpm_name); DrawPixmap(area_window, gc, BODY_PIXMAP_X, BODY_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); pixmap = LoadPixmap(window, &mask, out_xpm_name); DrawPixmap(area_window, gc, BODY_PIXMAP_X, BODY_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); pixmap = LoadPixmap(window, &mask, guide_xpm_name); DrawPixmap(area_window, gc, R_GUIDE_PIXMAP_X, R_GUIDE_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); } // Left guide(Thickness). { short thick = GetCurrentnValue(CNCL_MESS_THICK); switch( thick ) { case CND_TMESSAGE_UPPER2: xpm_name = "guide_b1.xpm"; break; default: xpm_name = "guide_b3.xpm"; break; } pixmap = LoadPixmap(window, &mask, xpm_name); DrawPixmap(area_window, gc, L_GUIDE_PIXMAP_X, L_GUIDE_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); } // Media type message. message_str = GetCurrentString(CNCL_MEDIATYPE); DrawString(area_window, g_main_font, gc, MEDIA_TEXT_X, MEDIA_TEXT_Y, message_str); { if( IsGrayPrint(g_main_window) ) { xpm_name = "print_mono.xpm"; key_str = "print_mono_message"; } else { xpm_name = "print_color.xpm"; key_str = "print_color_message"; } #ifndef NO_PRINT_COLOR_ICON // Print color icon. pixmap = LoadPixmap(window, &mask, xpm_name); DrawPixmap(area_window, gc, COLOR_PIXMAP_X, COLOR_PIXMAP_Y, pixmap, mask); FreePixmap(pixmap, mask); #endif // Color type message. message_str = LookupText(g_keytext_list, key_str); DrawString(area_window, g_main_font, gc, COLOR_TEXT_X, COLOR_TEXT_Y, message_str); } gdk_gc_unref(gc); }