Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
801fe030
Commit
801fe030
authored
Mar 20, 2011
by
Moritz Lipp
Browse files
Changed the strucure a bit
parent
c5491675
Changes
4
Hide whitespace changes
Inline
Side-by-side
document.c
View file @
801fe030
...
...
@@ -385,9 +385,13 @@ zathura_page_get(zathura_document_t* document, unsigned int page_id)
zathura_page_t
*
page
=
document
->
functions
.
page_get
(
document
,
page_id
);
if
(
page
)
{
page
->
number
=
page_id
;
page
->
rendered
=
false
;
page
->
event_box
=
gtk_event_box_new
();
page
->
number
=
page_id
;
page
->
rendered
=
false
;
page
->
event_box
=
gtk_event_box_new
();
page
->
drawing_area
=
gtk_drawing_area_new
();
gtk_container_add
(
GTK_CONTAINER
(
page
->
event_box
),
page
->
drawing_area
);
g_static_mutex_init
(
&
(
page
->
lock
));
}
...
...
document.h
View file @
801fe030
...
...
@@ -147,7 +147,8 @@ typedef struct zathura_page_s
zathura_document_t
*
document
;
/**> Document */
void
*
data
;
/**> Custom data */
bool
rendered
;
/**> Page has been rendered */
GtkWidget
*
event_box
;
/**> Widget wrapper */
GtkWidget
*
event_box
;
/**> Widget wrapper for mouse events */
GtkWidget
*
drawing_area
;
/**> Drawing area */
GStaticMutex
lock
;
/**> Lock */
}
zathura_page_t
;
...
...
render.c
View file @
801fe030
...
...
@@ -170,10 +170,7 @@ render(zathura_page_t* page)
}
/* draw to gtk widget */
GtkWidget
*
drawing_area
=
gtk_drawing_area_new
();
gtk_container_add
(
GTK_CONTAINER
(
page
->
event_box
),
drawing_area
);
cairo_t
*
cairo
=
gdk_cairo_create
(
drawing_area
->
window
);
cairo_t
*
cairo
=
gdk_cairo_create
(
page
->
drawing_area
->
window
);
cairo_set_source_surface
(
cairo
,
surface
,
0
,
0
);
cairo_paint
(
cairo
);
cairo_destroy
(
cairo
);
...
...
zathura.c
View file @
801fe030
...
...
@@ -224,16 +224,12 @@ create_blank_pages()
zathura_page_t
*
page
=
Zathura
.
document
->
pages
[
i
];
g_static_mutex_lock
(
&
(
page
->
lock
));
/* create blank page */
GtkWidget
*
image
=
page_blank
(
page
->
width
,
page
->
height
);
cairo_t
*
cairo
=
gdk_cairo_create
(
page
->
drawing_area
->
window
);
cairo_set_source_rgb
(
cairo
,
1
,
1
,
1
);
cairo_rectangle
(
cairo
,
0
,
0
,
page
->
width
,
page
->
height
);
cairo_fill
(
cairo
);
cairo_destroy
(
cairo
);
if
(
!
image
)
{
g_static_mutex_unlock
(
&
(
page
->
lock
));
continue
;
}
/* pack to page view */
gtk_container_add
(
GTK_CONTAINER
(
page
->
event_box
),
image
);
g_static_mutex_unlock
(
&
(
page
->
lock
));
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment