62
62
delete_event(GtkWidget *widget, gpointer data)
68
68
button_press_event_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
72
cursor = gdk_cursor_new (GDK_CROSSHAIR);
73
gdk_pointer_grab(widget->window, FALSE,
74
GDK_BUTTON_RELEASE_MASK |
75
GDK_POINTER_MOTION_MASK,
78
gdk_cursor_destroy (cursor);
80
gtk_window_get_position(GTK_WINDOW(widget),
82
&window_drag_start_y);
84
pointer_drag_start_x = (gint) event->x_root;
85
pointer_drag_start_y = (gint) event->y_root;
87
toolbar_dragging = TRUE;
74
switch (event->type) {
75
case GDK_BUTTON_PRESS:
76
cursor = gdk_cursor_new(GDK_FLEUR);
77
gdk_pointer_grab(widget->window, FALSE,
78
GDK_BUTTON_RELEASE_MASK |
79
GDK_POINTER_MOTION_MASK,
82
gdk_cursor_destroy(cursor);
84
gtk_window_get_position(GTK_WINDOW(widget),
86
&window_drag_start_y);
87
pointer_drag_start_x = (gint)event->x_root;
88
pointer_drag_start_y = (gint)event->y_root;
89
toolbar_dragging = TRUE;
91
case GDK_2BUTTON_PRESS:
92
toolbar = GTK_WIDGET(data);
93
if (GTK_WIDGET_VISIBLE(toolbar)) {
94
gtk_window_get_size(GTK_WINDOW(widget), &width, &height);
95
gtk_widget_hide(toolbar);
98
gtk_widget_show(toolbar);
100
gtk_widget_set_size_request(widget, -1, height);
93
110
helper_win_set_position(GtkWidget *window, gint x, gint y)
96
gint w, h, sc_w, sc_h;
98
sc_w = gdk_screen_width();
99
sc_h = gdk_screen_height();
101
gdk_window_get_size(window->window, &w, &h);
105
else if (wx > sc_w - w)
109
else if (wy > sc_h - h)
112
gtk_window_move(GTK_WINDOW(window), wx, wy);
113
gint w, h, sc_w, sc_h;
115
sc_w = gdk_screen_width();
116
sc_h = gdk_screen_height();
118
gdk_window_get_size(window->window, &w, &h);
122
else if (wx > sc_w - w)
126
else if (wy > sc_h - h)
129
gtk_window_move(GTK_WINDOW(window), wx, wy);
211
231
gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DOCK);
213
233
gtk_window_set_skip_taskbar_hint(GTK_WINDOW(window), TRUE);
214
gtk_window_set_decorated (GTK_WINDOW(window), FALSE);
234
gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
215
235
gtk_window_stick(GTK_WINDOW(window));
217
237
gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK);
219
g_signal_connect(G_OBJECT (window), "delete_event",
220
G_CALLBACK (delete_event), NULL);
239
frame = gtk_frame_new(NULL);
240
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
241
gtk_container_add(GTK_CONTAINER(window), frame);
243
hbox = gtk_hbox_new(FALSE, 0);
244
gtk_container_add(GTK_CONTAINER(frame), hbox);
246
handle = gtk_drawing_area_new();
247
gtk_widget_set_size_request(handle, 8, -1);
248
gtk_box_pack_start(GTK_BOX(hbox), handle, FALSE, FALSE, 0);
250
toolbar = (GtkWidget*)uim_toolbar_standalone_new();
251
gtk_box_pack_start(GTK_BOX(hbox), toolbar, FALSE, FALSE, 0);
253
g_signal_connect(G_OBJECT(handle), "expose-event",
254
G_CALLBACK(handle_expose_event_cb), NULL);
256
g_signal_connect(G_OBJECT(window), "delete_event",
257
G_CALLBACK(delete_event), NULL);
222
258
g_signal_connect(G_OBJECT(window), "button-press-event",
223
G_CALLBACK(button_press_event_cb), NULL);
259
G_CALLBACK(button_press_event_cb), toolbar);
224
260
g_signal_connect(G_OBJECT(window), "button-release-event",
225
261
G_CALLBACK(button_release_event_cb), NULL);
226
262
g_signal_connect(G_OBJECT(window), "motion-notify-event",
227
263
G_CALLBACK(motion_notify_event_cb), NULL);
228
264
g_signal_connect(G_OBJECT(window), "size-allocate",
229
265
G_CALLBACK(size_allocate_cb), NULL);
231
frame = gtk_frame_new(NULL);
232
gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
233
gtk_container_add (GTK_CONTAINER (window), frame);
235
hbox = gtk_hbox_new (FALSE, 0);
236
gtk_container_add (GTK_CONTAINER (frame), hbox);
238
handle = gtk_drawing_area_new();
239
g_signal_connect(G_OBJECT (handle), "expose-event",
240
G_CALLBACK (handle_expose_event_cb), NULL);
241
gtk_widget_set_size_request(handle, 8, -1);
242
gtk_box_pack_start(GTK_BOX (hbox), handle, FALSE, FALSE, 0);
244
toolbar = (GtkWidget*)uim_toolbar_standalone_new();
245
gtk_box_pack_start(GTK_BOX (hbox), toolbar, FALSE, FALSE, 0);
246
266
g_signal_connect(G_OBJECT(window), "size-request",
247
267
G_CALLBACK(size_request_cb), NULL);
249
gtk_widget_show_all(GTK_WIDGET (window));
269
gtk_widget_show_all(GTK_WIDGET(window));
252
if (!gtk_window_parse_geometry(GTK_WINDOW (window), argv[1])) {
272
if (!gtk_window_parse_geometry(GTK_WINDOW(window), argv[1])) {
254
274
#if GLIB_CHECK_VERSION(2, 6, 0)
255
275
parse_options(argc, argv);