pcb 4.1.1
An interactive printed circuit board layout editor.

ghid-cell-renderer-visibility.c File Reference

Implementation of GtkCellRenderer for layer visibility toggler. More...

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "gtkhid.h"
#include "gui.h"
#include "ghid-cell-renderer-visibility.h"
Include dependency graph for ghid-cell-renderer-visibility.c:

Go to the source code of this file.

Data Structures

struct  _GHidCellRendererVisibility
struct  _GHidCellRendererVisibilityClass

Enumerations

enum  { TOGGLED, LAST_SIGNAL }
enum  { PROP_ACTIVE = 1, PROP_COLOR }

Functions

static void ghid_cell_renderer_visibility_get_size (GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset, gint *y_offset, gint *width, gint *height)
 Calculates the window area the renderer will use.
static void ghid_cell_renderer_visibility_render (GtkCellRenderer *cell, GdkWindow *window, GtkWidget *widget, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, GtkCellRendererState flags)
 Actually renders the swatch.
static gint ghid_cell_renderer_visibility_activate (GtkCellRenderer *cell, GdkEvent *event, GtkWidget *widget, const gchar *path, GdkRectangle *background_area, GdkRectangle *cell_area, GtkCellRendererState flags)
 Toggless the swatch.
static void ghid_cell_renderer_visibility_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec)
static void ghid_cell_renderer_visibility_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec)
static void ghid_cell_renderer_visibility_init (GHidCellRendererVisibility *ls)
static void ghid_cell_renderer_visibility_class_init (GHidCellRendererVisibilityClass *klass)
GType ghid_cell_renderer_visibility_get_type (void)
GtkCellRenderer * ghid_cell_renderer_visibility_new (void)

Variables

static guint toggle_cell_signals [LAST_SIGNAL] = { 0 }

Detailed Description

Implementation of GtkCellRenderer for layer visibility toggler.

For details on the functions implemented here, see the Gtk documentation for the GtkCellRenderer object, which defines the interface we are implementing.

Definition in file ghid-cell-renderer-visibility.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
TOGGLED 
LAST_SIGNAL 

Definition at line 20 of file ghid-cell-renderer-visibility.c.

anonymous enum
Enumerator:
PROP_ACTIVE 
PROP_COLOR 

Definition at line 26 of file ghid-cell-renderer-visibility.c.


Function Documentation

static gint ghid_cell_renderer_visibility_activate ( GtkCellRenderer *  cell,
GdkEvent *  event,
GtkWidget *  widget,
const gchar *  path,
GdkRectangle *  background_area,
GdkRectangle *  cell_area,
GtkCellRendererState  flags 
) [static]

Toggless the swatch.

Definition at line 188 of file ghid-cell-renderer-visibility.c.

References toggle_cell_signals, TOGGLED, and TRUE.

Referenced by ghid_cell_renderer_visibility_class_init().

static void ghid_cell_renderer_visibility_class_init ( GHidCellRendererVisibilityClass klass) [static]

GHidCellRendererVisibility::toggled: : the object which received the signal : string representation of #GtkTreePath describing the event location

The ::toggled signal is emitted when the cell is toggled.

Definition at line 251 of file ghid-cell-renderer-visibility.c.

References _, FALSE, ghid_cell_renderer_visibility_activate(), ghid_cell_renderer_visibility_get_property(), ghid_cell_renderer_visibility_get_size(), ghid_cell_renderer_visibility_render(), ghid_cell_renderer_visibility_set_property(), PROP_ACTIVE, PROP_COLOR, toggle_cell_signals, and TOGGLED.

Referenced by ghid_cell_renderer_visibility_get_type().

Here is the call graph for this function:

static void ghid_cell_renderer_visibility_get_property ( GObject *  object,
guint  param_id,
GValue *  value,
GParamSpec *  pspec 
) [static]
static void ghid_cell_renderer_visibility_get_size ( GtkCellRenderer *  cell,
GtkWidget *  widget,
GdkRectangle *  cell_area,
gint *  x_offset,
gint *  y_offset,
gint *  width,
gint *  height 
) [static]

Calculates the window area the renderer will use.

Definition at line 52 of file ghid-cell-renderer-visibility.c.

References MAX, style, and VISIBILITY_TOGGLE_SIZE.

Referenced by ghid_cell_renderer_visibility_class_init(), and ghid_cell_renderer_visibility_render().

GType ghid_cell_renderer_visibility_get_type ( void  )

Definition at line 298 of file ghid-cell-renderer-visibility.c.

References ghid_cell_renderer_visibility_class_init(), and ghid_cell_renderer_visibility_init().

Here is the call graph for this function:

static void ghid_cell_renderer_visibility_init ( GHidCellRendererVisibility ls) [static]
GtkCellRenderer* ghid_cell_renderer_visibility_new ( void  )
static void ghid_cell_renderer_visibility_render ( GtkCellRenderer *  cell,
GdkWindow *  window,
GtkWidget *  widget,
GdkRectangle *  background_area,
GdkRectangle *  cell_area,
GdkRectangle *  expose_area,
GtkCellRendererState  flags 
) [static]
static void ghid_cell_renderer_visibility_set_property ( GObject *  object,
guint  param_id,
const GValue *  value,
GParamSpec *  pspec 
) [static]

Variable Documentation

guint toggle_cell_signals[LAST_SIGNAL] = { 0 } [static]