27 #ifdef CAIRO_HAS_XLIB_SURFACE
29 #include <X11/Xutil.h>
36 attr_value_edited_cb(GtkCellRendererText *renderer, gchar *pathStr, gchar *newText, gpointer
data)
38 GtkTreeModel *model = GTK_TREE_MODEL(data);
45 path = gtk_tree_path_new_from_string(pathStr);
46 row = gtk_tree_path_get_indices(path)[0];
51 gtk_tree_model_get_iter(model, &iter, path);
52 gtk_tree_model_get(model, &iter, 1, &old_attr, -1);
56 gtk_list_store_set(GTK_LIST_STORE(model), &iter, 1, g_strdup(newText), -1);
58 gtk_tree_path_free(path);
61 static void gtk_initialize(
GVJ_t *firstjob)
64 const char *display_name =
NULL;
72 bind_textdomain_codeset (GETTEXT_PACKAGE,
"UTF-8");
88 dpy = XOpenDisplay(display_name);
90 fprintf(stderr,
"Failed to open XLIB display: %s\n",
94 scr = DefaultScreen(dpy);
95 firstjob->
device_dpi.
x = DisplayWidth(dpy, scr) * 25.4 / DisplayWidthMM(dpy, scr);
96 firstjob->
device_dpi.
y = DisplayHeight(dpy, scr) * 25.4 / DisplayHeightMM(dpy, scr);
100 static void gtk_finalize(
GVJ_t *firstjob)
103 GtkWidget *window1, *drawingarea1, *drawingarea2, *treeview2;
104 GtkListStore *attr_store;
105 GtkCellRenderer *value_renderer;
107 for (job = firstjob; job; job = job->
next_active) {
110 g_object_set_data(G_OBJECT(window1),
"job", (gpointer) job);
113 g_object_set_data(G_OBJECT(drawingarea1),
"job", (gpointer) job);
116 g_object_set_data(G_OBJECT(drawingarea2),
"job", (gpointer) job);
119 g_object_set_data(G_OBJECT(treeview2),
"job", (gpointer) job);
121 attr_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
123 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview2), -1,
"Name",
124 gtk_cell_renderer_text_new(),
"text", 0,
NULL);
126 value_renderer = gtk_cell_renderer_text_new();
127 g_signal_connect(G_OBJECT(value_renderer),
"edited", G_CALLBACK(attr_value_edited_cb), attr_store);
128 g_object_set(G_OBJECT(value_renderer),
"editable",
TRUE,
"wrap-mode", PANGO_WRAP_WORD,
129 "wrap-width", 100,
NULL);
130 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview2), -1,
"Value", value_renderer,
133 gtk_tree_view_set_model(GTK_TREE_VIEW(treeview2), GTK_TREE_MODEL(attr_store));
134 g_object_set_data(G_OBJECT(drawingarea1),
"attr_store", attr_store);
136 gtk_widget_show (window1);
160 #ifdef CAIRO_HAS_XLIB_SURFACE
161 {0,
"gtk:cairo", 0, &device_engine_gtk, &device_features_gtk},
#define bindtextdomain(Domain, Directory)
gvplugin_installed_t gvdevice_types_gtk[]
#define textdomain(String)
GtkWidget * lookup_widget(GtkWidget *widget, const gchar *widget_name)
GtkWidget * create_window1(void)
#define GVDEVICE_DOES_TRUECOLOR