本文整理汇总了C++中GDK_DRAWABLE函数的典型用法代码示例。如果您正苦于以下问题:C++ GDK_DRAWABLE函数的具体用法?C++ GDK_DRAWABLE怎么用?C++ GDK_DRAWABLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GDK_DRAWABLE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: expose_event_top_right
gboolean expose_event_top_right(GtkWidget *widget,GdkEventExpose *event, gpointer user){
static GdkGC *this_gc = NULL;
TimeLinePrivate *priv;
gint new_cursor_pos;
gint width;
gint height;
priv = (TimeLinePrivate *)user;
if(priv->top_right_evb->window == NULL || priv->display_buffer_top_right == NULL){
return TRUE;
}
if (NULL == this_gc)
{
this_gc = gdk_gc_new(GDK_DRAWABLE(priv->top_right_evb->window));
}
width = ((get_current_slide_duration() +1) * time_line_get_pixels_per_second());
height = (get_current_slide_num_layers() *priv->row_height)+10;
if(width<priv->main_table->allocation.width)
width = priv->main_table->allocation.width;
if(height<priv->main_table->allocation.height)
height = priv->main_table->allocation.height;
new_cursor_pos = round(time_line_get_cursor_position(priv->main_table->parent) * time_line_get_pixels_per_second());
time_line_internal_draw_cursor(priv->main_table->parent, new_cursor_pos);
gdk_draw_drawable(GDK_DRAWABLE(priv->top_right_evb->window), GDK_GC(this_gc),
GDK_PIXMAP(priv->display_buffer_top_right),0,0,0,0,width, priv->top_border_height);
return TRUE;
}
开发者ID:justinclift,项目名称:salasaga,代码行数:31,代码来源:expose_event_top_right.c
示例2: gdk_gl_window_new
/**
* gdk_gl_window_new:
* @glconfig: a #GdkGLConfig.
* @window: the #GdkWindow to be used as the rendering area.
* @attrib_list: (array) (allow-none): this must be set to NULL or empty (first attribute of None).
*
* Creates an on-screen rendering area.
* attrib_list is currently unused. This must be set to NULL or empty
* (first attribute of None). See GLX 1.3 spec.
*
* Return value: the new #GdkGLWindow.
**/
GdkGLWindow *
gdk_gl_window_new (GdkGLConfig *glconfig, GdkWindow *window, const int *attrib_list)
{
GDK_GL_NOTE_FUNC ();
g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), NULL);
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
/*
* Get X Window.
*/
Window glxwindow = GDK_DRAWABLE_XID (GDK_DRAWABLE (window));
/*
* Instantiate the GdkGLWindowImplX11 object.
*/
GdkGLWindow *glwindow = g_object_new (GDK_TYPE_GL_WINDOW, NULL);
glwindow->drawable = GDK_DRAWABLE (window);
g_object_add_weak_pointer (G_OBJECT (glwindow->drawable), (gpointer *) &(glwindow->drawable));
glwindow->glxwindow = glxwindow;
glwindow->glconfig = glconfig;
g_object_ref (G_OBJECT (glwindow->glconfig));
glwindow->is_destroyed = FALSE;
return glwindow;
}
开发者ID:ayyi,项目名称:libwaveform,代码行数:44,代码来源:gdkglwindow.c
示例3: meta_ui_get_pixbuf_from_pixmap
GdkPixbuf *
meta_ui_get_pixbuf_from_pixmap (Pixmap pmap)
{
GdkPixmap *gpmap;
GdkScreen *screen;
GdkPixbuf *pixbuf;
GdkColormap *cmap;
int width, height, depth;
gpmap = gdk_pixmap_foreign_new (pmap);
screen = gdk_drawable_get_screen (gpmap);
gdk_drawable_get_size (GDK_DRAWABLE (gpmap), &width, &height);
depth = gdk_drawable_get_depth (GDK_DRAWABLE (gpmap));
if (depth <= 24)
cmap = gdk_screen_get_rgb_colormap (screen);
else
cmap = gdk_screen_get_rgba_colormap (screen);
pixbuf = gdk_pixbuf_get_from_drawable (NULL, gpmap, cmap, 0, 0, 0, 0,
width, height);
g_object_unref (gpmap);
return pixbuf;
}
开发者ID:AlexWillisson,项目名称:metacity-physics,代码行数:27,代码来源:ui.c
示例4: gdk_colormap_get_system
void WebBrowserObject::BrowserSnapshot(const char *fname)
{
int width, height;
char *c, *buf = 0;
GdkColormap *cmap = gdk_colormap_get_system();
gdk_drawable_get_size(GDK_DRAWABLE(mozilla->window), &width, &height);
GdkPixbuf *pix = gdk_pixbuf_get_from_drawable(0, GDK_DRAWABLE(mozilla->window), cmap, 0, 0, 0, 0, width, height);
if (pix) {
if (!fname) {
buf = strdup(location ? location : "lmboxweb");
buf = (char*)realloc(buf, strlen(buf) + 16);
fname = buf;
if ((c = strrchr(buf, '/'))) {
//fname = c + 1;
}
if ((c = strrchr(fname, '.'))) {
*c = 0;
}
strcat((char*)fname, ".png");
}
gdk_pixbuf_save (pix, fname, "png", NULL, NULL);
gdk_pixbuf_unref(pix);
printf("Webbrowser snapshot %s\n",fname);
}
gdk_colormap_unref(cmap);
lmbox_free(buf);
}
开发者ID:vseryakov,项目名称:lmbox,代码行数:27,代码来源:webbrowser.cpp
示例5: expose_callback
static gboolean
expose_callback (GtkWidget *event_box,
GdkEventButton *,
TSignalData *sigdata)
{
cairo_t *cr;
if (sigdata->event_box != NULL)
cr = gdk_cairo_create (GDK_DRAWABLE (sigdata->event_box->window));
else
{
cr = gdk_cairo_create (GDK_DRAWABLE (event_box->window));
sigdata->event_box = event_box;
}
if (sigdata->image != NULL)
{
GdkPixbuf *pxbf = gtk_image_get_pixbuf(GTK_IMAGE(sigdata->image));
gdk_cairo_set_source_pixbuf (cr, pxbf, 0,0);
cairo_paint (cr);
draw_grid(cr, sigdata->idata);
}
return TRUE;
}
开发者ID:Pitel,项目名称:morphing,代码行数:29,代码来源:gui_setgridwnd.cpp
示例6: gdk_wmspec_change_state
static void
gdk_wmspec_change_state (gboolean add,
GdkWindow *window,
GdkAtom state1,
GdkAtom state2)
{
GdkDisplay *display =
gdk_screen_get_display (gdk_drawable_get_screen (GDK_DRAWABLE (window)));
XEvent xev;
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
#define _NET_WM_STATE_ADD 1 /* add/set property */
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
xev.xclient.send_event = True;
xev.xclient.window = GDK_WINDOW_XID (window);
xev.xclient.message_type =
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE");
xev.xclient.format = 32;
xev.xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
xev.xclient.data.l[1] = gdk_x11_atom_to_xatom_for_display (display, state1);
xev.xclient.data.l[2] = gdk_x11_atom_to_xatom_for_display (display, state2);
XSendEvent (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (gdk_drawable_get_screen (GDK_DRAWABLE (window)))),
False, SubstructureRedirectMask | SubstructureNotifyMask,
&xev);
}
开发者ID:nightfly19,项目名称:renyang-learn,代码行数:30,代码来源:misc.cpp
示例7: xfwmPixmapRenderGdkPixbuf
gboolean
xfwmPixmapRenderGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
{
GdkPixbuf *src;
GdkPixmap *destw;
GdkVisual *gvisual;
GdkColormap *cmap;
gint width, height;
gint dest_x, dest_y;
g_return_val_if_fail (pm != NULL, FALSE);
g_return_val_if_fail (pm->pixmap != None, FALSE);
g_return_val_if_fail (pm->mask != None, FALSE);
destw = gdk_xid_table_lookup (pm->pixmap);
if (destw)
{
g_object_ref (G_OBJECT (destw));
}
else
{
destw = gdk_pixmap_foreign_new (pm->pixmap);
}
if (!destw)
{
g_warning ("Cannot get pixmap");
return FALSE;
}
gvisual = gdk_screen_get_system_visual (pm->screen_info->gscr);
cmap = gdk_x11_colormap_foreign_new (gvisual, pm->screen_info->cmap);
if (!cmap)
{
g_warning ("Cannot create colormap");
g_object_unref (destw);
return FALSE;
}
width = MIN (gdk_pixbuf_get_width (pixbuf), pm->width);
height = MIN (gdk_pixbuf_get_height (pixbuf), pm->height);
/* Add 1 for rounding */
dest_x = (pm->width - width + 1) / 2;
dest_y = (pm->height - height + 1) / 2;
src = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE (destw), cmap,
dest_x, dest_y, 0, 0, width, height);
gdk_pixbuf_composite (pixbuf, src, 0, 0, width, height,
0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 0xFF);
gdk_draw_pixbuf (GDK_DRAWABLE (destw), NULL, src, 0, 0, dest_x, dest_y,
width, height, GDK_RGB_DITHER_NONE, 0, 0);
g_object_unref (cmap);
g_object_unref (src);
g_object_unref (destw);
return TRUE;
}
开发者ID:victorbarna,项目名称:xfwm4_tiling,代码行数:60,代码来源:mypixmap.c
示例8: SetUpStatusBarStuff
void SetUpStatusBarStuff (GtkWidget* aWindow)
{
_String fName = baseDirectory & "GTKResources/striped.xpm";
statusBarLayout = pango_layout_new (screenPContext);
statusBarFontDesc = pango_font_description_new ();
stripedFill = gdk_pixmap_create_from_xpm (GDK_DRAWABLE(aWindow->window), NULL, NULL, fName.sData);
stripedFillGC = gdk_gc_new (GDK_DRAWABLE(aWindow->window));
if (stripedFill)
{
gdk_gc_set_fill (stripedFillGC,GDK_TILED);
gdk_gc_set_tile (stripedFillGC,stripedFill);
}
else
{
printf ("Failed to load a status bar .xpm from %s\n", fName.sData);
}
gdk_gc_set_line_attributes (stripedFillGC, 1, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
GdkColor saveFG = {0,0,0,0};
gdk_gc_set_foreground (stripedFillGC, &saveFG);
pango_font_description_set_family (statusBarFontDesc, statusBarFont.face.sData);
pango_font_description_set_style (statusBarFontDesc, (statusBarFont.style & HY_FONT_ITALIC) ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL);
pango_font_description_set_weight (statusBarFontDesc, (statusBarFont.style & HY_FONT_BOLD) ? PANGO_WEIGHT_BOLD : PANGO_WEIGHT_NORMAL);
pango_font_description_set_size (statusBarFontDesc, statusBarFont.size*PANGO_SCALE);
pango_layout_set_font_description (statusBarLayout, statusBarFontDesc ); // ref ?
pango_layout_set_width (statusBarLayout, -1);
redButtonIcon = (GdkPixbuf*)ProcureIconResource(4000);
yellowButtonIcon = (GdkPixbuf*)ProcureIconResource(4001);
greenButtonIcon = (GdkPixbuf*)ProcureIconResource(4002);
orangeButtonIcon = (GdkPixbuf*)ProcureIconResource(4003);
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:34,代码来源:main-GTK.cpp
示例9: time_line_internal_draw_layer_name
gboolean time_line_internal_draw_layer_name(TimeLinePrivate *priv, gint layer_number)
{
// Local variables
const GdkColor colour_black = {0, 0, 0, 0 };
static GdkColormap *colourmap = NULL; // Colourmap used for drawing
static GdkGC *display_buffer_gc = NULL;
static PangoContext *font_context = NULL;
static PangoFontDescription *font_description = NULL;
static PangoLayout *font_layout = NULL;
layer *layer_data;
GList *layer_pointer; // Points to the layers in the selected slide
GString *message = NULL;
message = g_string_new(NULL);
// Initialisation
if (NULL == colourmap)
{
colourmap = gdk_colormap_get_system();
gdk_drawable_set_colormap(GDK_DRAWABLE(priv->display_buffer_bot_left), GDK_COLORMAP(colourmap));
}
if (NULL == font_context)
{
font_context = gdk_pango_context_get();
}
if (NULL == font_layout)
{
font_layout = pango_layout_new(font_context);
}
if (NULL == display_buffer_gc)
{
display_buffer_gc = gdk_gc_new(GDK_DRAWABLE(priv->display_buffer_bot_left));
}
if (NULL == font_description)
{
font_description = pango_font_description_from_string("Sans , 15px");
pango_layout_set_font_description(font_layout, font_description);
}
// Retrieve the layer name string
layer_pointer = get_current_slide_layers_pointer();
layer_pointer = g_list_first(layer_pointer);
layer_data = g_list_nth_data(layer_pointer, layer_number);
// g_string_printf(message, "%d %s ",layer_number,layer_data->name->str);
pango_layout_set_text(font_layout, layer_data->name->str, -1);
// Set a clip mask
// clip_region.x = 0;
// clip_region.y = (layer_number <= 0)?0:(layer_number * priv->row_height);
// clip_region.width = priv->left_border_width - 1;
// clip_region.height = priv->row_height * 2;
// gdk_gc_set_clip_rectangle(GDK_GC(display_buffer_gc), &clip_region);
// Draw the text string
gdk_gc_set_rgb_fg_color(GDK_GC(display_buffer_gc), &colour_black);
gdk_draw_layout(GDK_DRAWABLE(priv->display_buffer_bot_left), GDK_GC(display_buffer_gc), 5, (layer_number * priv->row_height)+1,font_layout);
return TRUE;
}
开发者ID:justinclift,项目名称:salasaga,代码行数:59,代码来源:time_line_internal_draw_layer_name.c
示例10: gdk_gl_pixmap_impl_x11_make_context_current
static gboolean
gdk_gl_pixmap_impl_x11_make_context_current (GdkGLDrawable *draw,
GdkGLDrawable *read,
GdkGLContext *glcontext)
{
GdkGLConfig *glconfig;
GLXPixmap glxpixmap;
GLXContext glxcontext;
g_return_val_if_fail (GDK_IS_GL_PIXMAP_IMPL_X11 (draw), FALSE);
g_return_val_if_fail (GDK_IS_GL_CONTEXT_IMPL_X11 (glcontext), FALSE);
glconfig = GDK_GL_PIXMAP_IMPL_X11 (draw)->glconfig;
glxpixmap = GDK_GL_PIXMAP_IMPL_X11 (draw)->glxpixmap;
glxcontext = GDK_GL_CONTEXT_GLXCONTEXT (glcontext);
if (glxpixmap == None || glxcontext == NULL)
return FALSE;
#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
GDK_GL_NOTE (MISC,
g_message (" -- Pixmap: screen number = %d",
GDK_SCREEN_XNUMBER (gdk_drawable_get_screen (GDK_DRAWABLE (draw)))));
#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */
GDK_GL_NOTE (MISC,
g_message (" -- Pixmap: visual id = 0x%lx",
GDK_VISUAL_XVISUAL (gdk_drawable_get_visual (GDK_DRAWABLE (draw)))->visualid));
GDK_GL_NOTE_FUNC_IMPL ("glXMakeCurrent");
if (!glXMakeCurrent (GDK_GL_CONFIG_XDISPLAY (glconfig), glxpixmap, glxcontext))
{
g_warning ("glXMakeCurrent() failed");
_gdk_gl_context_set_gl_drawable (glcontext, NULL);
/* currently unused. */
/* _gdk_gl_context_set_gl_drawable_read (glcontext, NULL); */
return FALSE;
}
_gdk_gl_context_set_gl_drawable (glcontext, draw);
/* currently unused. */
/* _gdk_gl_context_set_gl_drawable_read (glcontext, read); */
if (_GDK_GL_CONFIG_AS_SINGLE_MODE (glconfig))
{
/* We do this because we are treating a double-buffered frame
buffer as a single-buffered frame buffer because the system
does not appear to export any suitable single-buffered
visuals (in which the following are necessary). */
glDrawBuffer (GL_FRONT);
glReadBuffer (GL_FRONT);
}
GDK_GL_NOTE (MISC, _gdk_gl_print_gl_info ());
return TRUE;
}
开发者ID:DX-MON,项目名称:gtkGLExt2,代码行数:57,代码来源:gdkglpixmap-x11.c
示例11: gtk_widget_get_root_window
GdkPixmap *make_pixmap(GtkScrollbox *self, gchar *value)
{
GdkWindow *rootwin;
PangoLayout *pl;
gint width, height, middle;
GdkPixmap *pixmap;
GtkRequisition widgsize = {0, };
GtkWidget *widget = (GtkWidget *)self;
/* If we can't draw yet, don't do anything to avoid screwing things */
if (!GDK_IS_GC(widget->style->bg_gc[0]))
return NULL;
rootwin = gtk_widget_get_root_window(widget);
pl = gtk_widget_create_pango_layout(widget, NULL);
pango_layout_set_markup(pl, value, -1);
pango_layout_get_pixel_size(pl, &width, &height);
pixmap = gdk_pixmap_new(GDK_DRAWABLE(rootwin), width, height, -1);
gdk_draw_rectangle(GDK_DRAWABLE(pixmap),
widget->style->bg_gc[0],
TRUE, 0, 0, width, height);
gdk_draw_layout(GDK_DRAWABLE(pixmap), widget->style->fg_gc[0], 0, 0, pl);
g_object_unref(pl);
gtk_widget_size_request(widget, &widgsize);
if (width <= widgsize.width)
width = widgsize.width;
if (height <= widgsize.height)
height = widgsize.height;
else
self->draw_maxoffset = -height;
if (width != widgsize.width || height != widgsize.height)
gtk_widget_set_size_request(widget, width, height);
middle = width / 2;
if (self->draw_maxmiddle < middle)
self->draw_maxmiddle = middle;
return pixmap;
}
开发者ID:BackupTheBerlios,项目名称:xfce-goodies-svn,代码行数:50,代码来源:scrollbox.c
示例12: debug_save_widget
void debug_save_widget(GtkWidget *widget)
{
GdkPixmap *pixmap;
GdkPixbuf *pixbuf;
gint w, h;
pixmap = gtk_widget_get_snapshot(widget, NULL);
gdk_drawable_get_size(GDK_DRAWABLE(pixmap), &w, &h);
pixbuf = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE(pixmap),
NULL, 0, 0, 0, 0, w, h);
debug_save_pixbuf(pixbuf);
gdk_pixmap_unref(pixmap);
g_object_unref(pixbuf);
}
开发者ID:bert,项目名称:fped,代码行数:14,代码来源:gui_util.c
示例13: gtk_experiment_transcript_expose
static gboolean
gtk_experiment_transcript_expose(GtkWidget *widget, GdkEventExpose *event)
{
GtkExperimentTranscript *trans = GTK_EXPERIMENT_TRANSCRIPT(widget);
gdk_draw_drawable(GDK_DRAWABLE(gtk_widget_get_window(widget)),
widget->style->fg_gc[gtk_widget_get_state(widget)],
GDK_DRAWABLE(trans->priv->layer_text),
event->area.x, event->area.y,
event->area.x, event->area.y,
event->area.width, event->area.height);
return FALSE;
}
开发者ID:rhaberkorn,项目名称:experiment-player,代码行数:14,代码来源:gtk-experiment-transcript.c
示例14: UI_buildui
void UI_buildui(IBusHandwriteEngine * engine)
{
GdkPixmap * pxmp;
GdkGC * gc;
GdkColor black, white;
GdkColormap* colormap = gdk_colormap_get_system();
gdk_color_black(colormap, &black);
gdk_color_white(colormap, &white);
g_object_unref(colormap);
int R = 5;
if (!engine->drawpanel)
//建立绘图窗口, 建立空点
{
engine->drawpanel = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_move((GtkWindow*) engine->drawpanel, 500, 550);
gtk_widget_add_events(GTK_WIDGET(engine->drawpanel),
GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_BUTTON_PRESS_MASK | GDK_EXPOSURE_MASK);
g_signal_connect_after(G_OBJECT(engine->drawpanel),"motion_notify_event",G_CALLBACK(on_mouse_move),engine);
g_signal_connect(G_OBJECT(engine->drawpanel),"expose-event",G_CALLBACK(paint_ui),engine);
g_signal_connect(G_OBJECT(engine->drawpanel),"button-release-event",G_CALLBACK(on_button),engine);
g_signal_connect(G_OBJECT(engine->drawpanel),"button-press-event",G_CALLBACK(on_button),engine);
gtk_window_resize(GTK_WINDOW(engine->drawpanel), 200, 250);
gtk_widget_show(engine->drawpanel);
pxmp = gdk_pixmap_new(NULL, 200, 250, 1);
gc = gdk_gc_new(GDK_DRAWABLE(pxmp));
gdk_gc_set_foreground(gc, &black);
gdk_draw_rectangle(GDK_DRAWABLE(pxmp), gc, 1, 0, 0, 200, 250);
gdk_gc_set_foreground(gc, &white);
gdk_draw_arc(GDK_DRAWABLE(pxmp), gc, 1, 0, 0, R*2, R*2, 0, 360 * 64);
gdk_draw_arc(GDK_DRAWABLE(pxmp), gc, 1, 200 - R*2, 0, R*2, R*2, 0, 360
* 64);
gdk_draw_arc(GDK_DRAWABLE(pxmp), gc, 1, 200 - R*2, 250 - R*2, R*2, R*2, 0,
360 * 64);
gdk_draw_arc(GDK_DRAWABLE(pxmp), gc, 1, 0, 250 - R*2, R*2, R*2, 0, 360
* 64);
gdk_draw_rectangle(GDK_DRAWABLE(pxmp), gc, 1, 0, R, 200, 250 - R*2);
gdk_draw_rectangle(GDK_DRAWABLE(pxmp), gc, 1, R, 0, 200 - R*2, 250);
gdk_window_shape_combine_mask(engine->drawpanel->window, pxmp, 0, 0);
g_object_unref(gc);
g_object_unref(pxmp);
gtk_window_set_opacity(GTK_WINDOW(engine->drawpanel), 0.62);
// engine->GdkPoints = NULL;
}
// gtk_widget_show_all(engine->drawpanel);
}
开发者ID:Nomad280279,项目名称:ibus-handwrite,代码行数:58,代码来源:UI_gtk.c
示例15: _VisibleContents
void _HYSequencePane::_Paint (Ptr p)
{
_HYRect* destR = (_HYRect*)p;
_HYRect srcRect,
destRect = *destR;
//printf ("Sequence Paint Called %d %d %d %d\n", destR->left, destR->top, destR->right, destR->bottom);
if (HasHScroll())
destRect.bottom-= HY_SCROLLER_WIDTH;
if (HasVScroll())
destRect.right -= HY_SCROLLER_WIDTH;
//destRect.left = destR->left;
//destRect.top = destR->top;
_HYRect srcR = _VisibleContents (p);
gdk_draw_drawable (GDK_DRAWABLE(parentWindow->window), theContext, thePane, 0, 0,
parentWindow->allocation.x+destRect.left, parentWindow->allocation.y+destRect.top, destRect.Width(), destRect.Height());
long saveBorder = settings.width & HY_COMPONENT_BORDER;
settings.width -= saveBorder;
_HYPlatformComponent::_Paint(p);
settings.width += saveBorder;
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:27,代码来源:HYPlatformSequencePane.cpp
示例16: gdk_drawable_impl_x11_finalize
static void
gdk_drawable_impl_x11_finalize (GObject *object)
{
gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
G_OBJECT_CLASS (_gdk_drawable_impl_x11_parent_class)->finalize (object);
}
开发者ID:chipx86,项目名称:gtk,代码行数:7,代码来源:gdkdrawable-x11.c
示例17: rg_s_from_drawable
static VALUE
rg_s_from_drawable(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self)
{
VALUE cmap, src, src_x, src_y, width, height, dest, dest_x, dest_y;
GdkPixbuf* buf;
rb_scan_args(argc, argv, "63", &cmap, &src, &src_x, &src_y, &width, &height,
&dest, &dest_x, &dest_y);
buf = gdk_pixbuf_get_from_drawable(GDK_PIXBUF(RVAL2GOBJ(dest)),
GDK_DRAWABLE(RVAL2GOBJ(src)),
GDK_COLORMAP(RVAL2GOBJ(cmap)),
NUM2INT(src_x), NUM2INT(src_y),
NIL_P(dest_x) ? 0 : NUM2INT(dest_x),
NIL_P(dest_y) ? 0 : NUM2INT(dest_y),
NUM2INT(width), NUM2INT(height));
if (NIL_P(dest)) {
if (buf) {
return GOBJ2RVALU(buf);
} else {
return Qnil;
}
} else {
return dest;
}
}
开发者ID:Vasfed,项目名称:ruby-gnome2,代码行数:26,代码来源:rbgdkpixbuf.c
示例18: copy
/* Copy selection */
void copy(GtkWidget *widget, gpointer data){//widget and data are useless
if (!selection_is_on)
show_error_message("No hay nada seleccionado para copiar");
save_paste_positions();
clipboard_pixbuf = gdk_pixbuf_get_from_drawable(NULL,GDK_DRAWABLE(canvas->window),gdk_colormap_get_system(),selection_x1,selection_y1,0,0,selection_x2-selection_x1,selection_y2-selection_y1);
}
开发者ID:kmels,项目名称:x-painter,代码行数:8,代码来源:tools.c
示例19: piano_keyboard_expose
static gboolean
piano_keyboard_expose(GtkWidget *widget, GdkEventExpose *event)
{
int i;
PianoKeyboard *pk = PIANO_KEYBOARD(widget);
cairo_t* cr = gdk_cairo_create (GDK_DRAWABLE (GTK_WIDGET(pk)->window));
gdk_cairo_region (cr, event->region);
cairo_clip (cr);
for (i = 0; i < NNOTES; i++) {
GdkRectangle r;
r.x = pk->notes[i].x;
r.y = 0;
r.width = pk->notes[i].w;
r.height = pk->notes[i].h;
switch (gdk_region_rect_in (event->region, &r)) {
case GDK_OVERLAP_RECTANGLE_PART:
case GDK_OVERLAP_RECTANGLE_IN:
draw_note (pk, cr, i);
break;
default:
break;
}
}
cairo_destroy (cr);
return TRUE;
}
开发者ID:gesius,项目名称:AudioComplete,代码行数:32,代码来源:gtk_pianokeyboard.c
示例20: player_av_set_video_destination
static void
player_av_set_video_destination (Player *self, GtkWidget *dest)
{
PlayerAVPrivate *priv = PLAYER_AV (self)->priv;
if (priv->video_dest) {
gdk_window_invalidate_rect (priv->video_dest->window, NULL, TRUE);
}
priv->video_dest = dest;
if (dest) {
player_av_change_gdk_window (PLAYER_AV (self), dest->window);
} else {
if (priv->fullscreen) {
player_av_change_gdk_window (PLAYER_AV (self), priv->fs_da->window);
priv->video_dest = priv->fs_da;
} else {
player_av_change_gdk_window (PLAYER_AV (self), priv->em_da->window);
priv->video_dest = priv->em_da;
}
}
g_signal_connect (priv->video_dest, "size-allocate", G_CALLBACK (on_alloc_event), self);
gdk_drawable_get_size (GDK_DRAWABLE (priv->video_dest->window),
&priv->win_width, &priv->win_height);
}
开发者ID:bmravec,项目名称:GMediaMP,代码行数:28,代码来源:player-av.c
注:本文中的GDK_DRAWABLE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论