Lines Matching defs:context
94 Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
106 if (context->paragraph != NULL) {
107 delete context->paragraph;
110 context->paragraph = newPara;
114 context->paragraph->breakLines(context->width, context->height);
209 gint eventConfigure(GtkWidget */*widget*/, GdkEventConfigure *event, Context *context)
211 if (context->paragraph != NULL) {
212 context->width = event->width;
213 context->height = event->height;
215 if (context->width > 0 && context->height > 0) {
216 context->paragraph->breakLines(context->width, context->height);
223 gint eventExpose(GtkWidget *widget, GdkEvent */*event*/, Context *context)
225 if (context->paragraph != NULL) {
226 gint maxLines = context->paragraph->getLineCount() - 1;
227 gint firstLine = 0, lastLine = context->height / context->paragraph->getLineHeight();
230 context->paragraph->draw(&surface, firstLine, (maxLines < lastLine)? maxLines : lastLine);
238 Context *context = new Context();
240 context->width = 600;
241 context->height = 400;
242 context->paragraph = Paragraph::paragraphFactory(fileName, font, guiSupport);
247 gtk_object_set_data(GTK_OBJECT(app), "context", context);
272 context);
277 context);
288 Context *context = (Context *) gtk_object_get_data(GTK_OBJECT(app), "context");
290 if (context->paragraph != NULL) {
291 delete context->paragraph;
294 delete context;