本文整理汇总了C++中GTK_WIDGET_DRAWABLE函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_WIDGET_DRAWABLE函数的具体用法?C++ GTK_WIDGET_DRAWABLE怎么用?C++ GTK_WIDGET_DRAWABLE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_WIDGET_DRAWABLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: panels_expose
static gint panels_expose(GtkWidget *widget, GdkEventExpose *event)
{
Panels *panels;
GtkWidget *child;
GList *children;
GdkEventExpose child_event;
g_return_val_if_fail(widget != NULL, FALSE);
g_return_val_if_fail(IS_PANELS(widget), FALSE);
g_return_val_if_fail(event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE(widget)) {
panels = PANELS(widget);
child_event = *event;
for (children = panels->children;
children && (child = children->data);
children = children->next) {
if (child &&
GTK_WIDGET_DRAWABLE(child) &&
GTK_WIDGET_NO_WINDOW(child) &&
gtk_widget_intersect(child, &event->area,
&child_event.area))
gtk_widget_event(child, (GdkEvent *)&child_event);
}
}
return FALSE;
}
示例2: columns_expose
static gint columns_expose(GtkWidget *widget, GdkEventExpose *event)
{
Columns *cols;
ColumnsChild *child;
GList *children;
GdkEventExpose child_event;
g_return_val_if_fail(widget != NULL, FALSE);
g_return_val_if_fail(IS_COLUMNS(widget), FALSE);
g_return_val_if_fail(event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE(widget)) {
cols = COLUMNS(widget);
child_event = *event;
for (children = cols->children; children && (child = children->data);
children = children->next) {
if (child->widget && GTK_WIDGET_DRAWABLE(child->widget) &&
GTK_WIDGET_NO_WINDOW(child->widget) &&
gtk_widget_intersect(child->widget, &event->area, &child_event.area))
gtk_widget_event(child->widget, (GdkEvent *)&child_event);
}
}
return FALSE;
}
示例3: gtk_form_draw
static void
gtk_form_draw(GtkWidget *widget, GdkRectangle *area)
{
GtkForm *form;
GList *children;
GtkFormChild *child;
GdkRectangle child_area;
g_return_if_fail(GTK_IS_FORM(widget));
if (GTK_WIDGET_DRAWABLE(widget))
{
form = GTK_FORM(widget);
children = form->children;
while (children)
{
child = children->data;
if (GTK_WIDGET_DRAWABLE(child->widget)
&& gtk_widget_intersect(child->widget, area, &child_area))
gtk_widget_draw(child->widget, &child_area);
children = children->next;
}
}
}
示例4: columns_focus
/*
* Override GtkContainer's focus movement so the user can
* explicitly specify the tab order.
*/
static gint columns_focus(GtkContainer *container, GtkDirectionType dir)
{
Columns *cols;
GList *pos;
GtkWidget *focuschild;
g_return_val_if_fail(container != NULL, FALSE);
g_return_val_if_fail(IS_COLUMNS(container), FALSE);
cols = COLUMNS(container);
if (!GTK_WIDGET_DRAWABLE(cols) ||
!GTK_WIDGET_IS_SENSITIVE(cols))
return FALSE;
if (!GTK_WIDGET_CAN_FOCUS(container) &&
(dir == GTK_DIR_TAB_FORWARD || dir == GTK_DIR_TAB_BACKWARD)) {
focuschild = container->focus_child;
gtk_container_set_focus_child(container, NULL);
if (dir == GTK_DIR_TAB_FORWARD)
pos = cols->taborder;
else
pos = g_list_last(cols->taborder);
while (pos) {
GtkWidget *child = pos->data;
if (focuschild) {
if (focuschild == child) {
focuschild = NULL; /* now we can start looking in here */
if (GTK_WIDGET_DRAWABLE(child) &&
GTK_IS_CONTAINER(child) &&
!GTK_WIDGET_HAS_FOCUS(child)) {
if (gtk_container_focus(GTK_CONTAINER(child), dir))
return TRUE;
}
}
} else if (GTK_WIDGET_DRAWABLE(child)) {
if (GTK_IS_CONTAINER(child)) {
if (gtk_container_focus(GTK_CONTAINER(child), dir))
return TRUE;
} else if (GTK_WIDGET_CAN_FOCUS(child)) {
gtk_widget_grab_focus(child);
return TRUE;
}
}
if (dir == GTK_DIR_TAB_FORWARD)
pos = pos->next;
else
pos = pos->prev;
}
return FALSE;
} else
return columns_inherited_focus(container, dir);
}
示例5: awt_gtk_panel_expose
static gint
awt_gtk_panel_expose (GtkWidget *widget,
GdkEventExpose *event)
{
AWTGtkPanel *panel;
GtkWidget *child;
GdkEventExpose child_event;
GList *children;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (GTK_WIDGET_DRAWABLE (widget))
{
panel = AWT_GTK_PANEL (widget);
child_event = *event;
children = panel->children;
while (children)
{
child = children->data;
children = children->next;
if (GTK_WIDGET_NO_WINDOW (child) &&
gtk_widget_intersect (child, &event->area,
&child_event.area))
gtk_widget_event (child, (GdkEvent*) &child_event);
}
}
return FALSE;
}
示例6: awt_gtk_panel_draw
static void
awt_gtk_panel_draw (GtkWidget *widget,
GdkRectangle *area)
{
AWTGtkPanel *panel;
GtkWidget *child;
GdkRectangle child_area;
GList *children;
g_return_if_fail (widget != NULL);
if (GTK_WIDGET_DRAWABLE (widget))
{
panel = AWT_GTK_PANEL (widget);
awt_gtk_panel_paint (widget, area);
children = panel->children;
while (children)
{
child = children->data;
children = children->next;
if (gtk_widget_intersect (child, area, &child_area))
gtk_widget_draw (child, &child_area);
}
}
}
示例7: _container_propagate_expose
/*
From gtkcontainer.c
*/
void
_container_propagate_expose (GtkContainer *container,
GtkWidget *child,
GdkEventExpose *event)
{
GdkEvent *child_event;
g_return_if_fail (GTK_IS_CONTAINER (container));
g_return_if_fail (GTK_IS_WIDGET (child));
g_return_if_fail (event != NULL);
g_assert (child->parent == GTK_WIDGET (container));
if (GTK_WIDGET_DRAWABLE (child) &&
GTK_WIDGET_NO_WINDOW (child) &&
(child->window == event->window)&&
AWN_IS_CAIRO_MENU_ITEM(child))
{
child_event = gdk_event_new (GDK_EXPOSE);
child_event->expose = *event;
g_object_ref (child_event->expose.window);
child_event->expose.region = gtk_widget_region_intersect (child, event->region);
if (!gdk_region_empty (child_event->expose.region))
{
gdk_region_get_clipbox (child_event->expose.region, &child_event->expose.area);
gtk_widget_send_expose (child, child_event);
}
gdk_event_free (child_event);
}
}
示例8: gwy_vruler_draw_ticks
static void
gwy_vruler_draw_ticks(GwyRuler *ruler)
{
GtkWidget *widget;
GdkGC *gc;
gint width, height;
gint xthickness;
gint ythickness;
if (!GTK_WIDGET_DRAWABLE(ruler))
return;
widget = GTK_WIDGET(ruler);
gc = widget->style->fg_gc[GTK_STATE_NORMAL];
xthickness = widget->style->xthickness;
ythickness = widget->style->ythickness;
height = widget->allocation.height;
width = widget->allocation.width - 2*xthickness;
gdk_draw_line(ruler->backing_store, gc,
height + xthickness,
ythickness,
height + xthickness,
widget->allocation.height - ythickness);
gwy_vruler_real_draw_ticks(ruler, height,
xthickness + MINIMUM_INCR, MINIMUM_INCR);
}
示例9: sp_gradient_image_update
static void
sp_gradient_image_update (SPGradientImage *image)
{
GtkAllocation *allocation;
if (!image->px) return;
allocation = &((GtkWidget *) image)->allocation;
if (image->gradient) {
nr_render_checkerboard_rgb (image->px, allocation->width, VBLOCK, 3 * allocation->width, 0, 0);
sp_gradient_render_vector_block_rgb (image->gradient,
image->px, allocation->width, VBLOCK, 3 * allocation->width,
0, allocation->width, TRUE);
} else {
NRPixBlock pb;
nr_pixblock_setup_extern (&pb, NR_PIXBLOCK_MODE_R8G8B8,
0, 0, allocation->width, VBLOCK,
image->px, 3 * allocation->width, TRUE, FALSE);
nr_pixblock_render_gray_noise (&pb, NULL);
nr_pixblock_release (&pb);
}
if (GTK_WIDGET_DRAWABLE (image)) {
gtk_widget_queue_draw (GTK_WIDGET (image));
}
}
示例10: screensaver_idle_handler
static int screensaver_idle_handler(gpointer user_data) {
ScreenSaver *self = SCREENSAVER(user_data);
iterative_map_calculate_motion(ITERATIVE_MAP(self->frame_renders[self->current_frame]), 100000,
TRUE, PARAMETER_INTERPOLATOR(parameter_holder_interpolate_linear),
&self->frame_parameters[self->current_frame]);
if (GTK_WIDGET_DRAWABLE(self->view)) {
histogram_view_set_imager(HISTOGRAM_VIEW(self->view),
HISTOGRAM_IMAGER(self->frame_renders[self->current_frame]));
histogram_view_update(HISTOGRAM_VIEW(self->view));
self->current_frame += self->direction;
if (self->current_frame >= self->num_frames) {
self->current_frame = self->num_frames-2;
self->direction = -1;
}
if (self->current_frame < 0) {
self->current_frame = 1;
self->direction = 1;
}
}
return 1;
}
示例11: ppg_ruler_size_allocate
/**
* ppg_ruler_size_allocate:
* @ruler: (in): A #PpgRuler.
*
* Handle the "size-allocate" for the #GtkWidget. The pixmap for the
* background is created and drawn if necessary.
*
* Returns: None.
* Side effects: None.
*/
static void
ppg_ruler_size_allocate (GtkWidget *widget,
GtkAllocation *alloc)
{
PpgRuler *ruler = (PpgRuler *)widget;
PpgRulerPrivate *priv;
GdkColormap *colormap;
GdkVisual *visual;
g_return_if_fail(PPG_IS_RULER(ruler));
priv = ruler->priv;
GTK_WIDGET_CLASS(ppg_ruler_parent_class)->size_allocate(widget, alloc);
if (priv->ruler) {
g_object_unref(priv->ruler);
}
priv->ruler = gdk_pixmap_new(NULL, alloc->width, alloc->height, 32);
visual = gdk_visual_get_best_with_depth(32);
colormap = gdk_colormap_new(visual, FALSE);
gdk_drawable_set_colormap(priv->ruler, colormap);
if (GTK_WIDGET_DRAWABLE(widget)) {
ppg_ruler_draw_ruler(ruler);
}
}
示例12: gtk_vkb_button_expose
static gboolean
gtk_vkb_button_expose (GtkWidget *widget, GdkEventExpose *event)
{
GtkVkbButton *button = GTK_VKB_BUTTON(widget);
GtkWidget *child;
GList *children;
GList *tmplist;
g_return_val_if_fail(widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_VKB_BUTTON(widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if(GTK_WIDGET_DRAWABLE(widget)){
GtkStateType state = GTK_WIDGET_STATE(widget);
if (!button->bg_pixmap) {
gdk_window_set_background(widget->window, &button->bgcolor[state]);
gdk_window_clear(widget->window);
}
children = gtk_container_get_children(GTK_CONTAINER(widget));
tmplist = children;
while (tmplist) {
child = GTK_WIDGET(tmplist->data);
tmplist = tmplist->next;
gtk_container_propagate_expose(GTK_CONTAINER(widget),
child, event);
}
g_list_free(children);
}
return FALSE;
}
示例13: immerse_clamp_detail_offset
static gboolean
immerse_clamp_detail_offset(ImmerseControls *controls,
gdouble xpos, gdouble ypos)
{
xpos = CLAMP(xpos, 0.0, controls->xmax);
ypos = CLAMP(ypos, 0.0, controls->ymax);
if (xpos != controls->args->xpos || ypos != controls->args->ypos) {
gchar *s;
controls->args->xpos = xpos;
controls->args->ypos = ypos;
s = g_strdup_printf("(%.*f, %.*f) %s",
controls->vf->precision + 1,
xpos/controls->vf->magnitude,
controls->vf->precision + 1,
ypos/controls->vf->magnitude,
controls->vf->units);
gtk_label_set_text(GTK_LABEL(controls->pos), s);
g_free(s);
if (GTK_WIDGET_DRAWABLE(controls->view))
gtk_widget_queue_draw(controls->view);
return TRUE;
}
return FALSE;
}
示例14: gtk_ev_push_text
/* Pøidání textového popisu události do seznamu zachycených událostí we
* widgetu */
static void gtk_ev_push_text(GtkEv *ev, const gchar* text)
{
g_return_if_fail(ev);
if(text) {
gchar** event;
event = g_strsplit(text, "\n", 10);
ev->list = g_list_prepend(ev->list, event);
ev->list_len ++;
if(ev->list_end == NULL)
ev->list_end = ev->list;
if(ev->list_len > 100) {
GList* prev = ev->list_end->prev;
prev->next = NULL;
g_strfreev(ev->list_end->data);
g_list_free_1(ev->list_end);
ev->list_end = prev;
ev->list_len--;
}
}
if(GTK_WIDGET_DRAWABLE(ev))
gtk_widget_queue_draw_area(GTK_WIDGET(ev), ev->list_rect.x,
ev->list_rect.y, ev->list_rect.width,
ev->list_rect.height);
}
示例15: HILDON_VOLUMEBAR_GET_PRIVATE
static gboolean
hildon_vvolumebar_expose (GtkWidget *widget,
GdkEventExpose *event)
{
HildonVolumebarPrivate *priv;
priv = HILDON_VOLUMEBAR_GET_PRIVATE(HILDON_VOLUMEBAR(widget));
g_assert (priv);
if (GTK_WIDGET_DRAWABLE (widget)) {
/* Paint background */
gtk_paint_box (widget->style, widget->window,
GTK_WIDGET_STATE (priv->volumebar), GTK_SHADOW_OUT,
NULL, widget, "background",
widget->allocation.x,
widget->allocation.y,
widget->allocation.width,
widget->allocation.height);
/* The contents of the widget can paint themselves */
(*GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
}
return FALSE;
}